Hi all,
I'm having some strange trouble with a PHP Mailform script that i'm hoping someone can help me out with.
The website is http://www.scottandbottietheknot.co.uk/ - on the site are 2 mail form scripts. 1 on the homepage, and the other on the RSVP page.
Now the form on the homepage works fine - ignore this form. Its the form on the RSVP page that isn't behaving properly.
(BTW both forms us the same php mail script)
On the RSVP page, if i submit a form with text elements WITH NO SPACES in them, the form submits fine, and the data is e-mailed to the relevant e-mail address. However, if i put in for example "John Doe" in the text box (note the space in the string) then the form doesn't submit.
The really strange thing, is that SPACES DO WORK on the homepage form. As mentioned both pages use the same script, so i don't know how this is even possible or how to fix it.
Please could someone help.
Thanks
Dan
PHP Mail form script doesnt like SPACES in textboxes
Moderator: General Moderators
-
dandaman2010
- Forum Newbie
- Posts: 2
- Joined: Mon Feb 08, 2010 2:04 pm
-
limitdesigns
- Forum Commoner
- Posts: 25
- Joined: Sat Feb 06, 2010 9:05 pm
Re: PHP Mail form script doesnt like SPACES in textboxes
Could you post the form handler script you're using?
-
dandaman2010
- Forum Newbie
- Posts: 2
- Joined: Mon Feb 08, 2010 2:04 pm
Re: PHP Mail form script doesnt like SPACES in textboxes
The mailscript is this.....
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>
<!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitor2 = $_POST['visitor2'];
$group1 = $_POST['group1'];
$group2 = $_POST['group2'];
$dietary = $_POST['dietary'];
$dietary2 = $_POST['dietary2'];
$artist = $_POST['artist'];
$artist2 = $_POST['artist2'];
$artist3 = $_POST['artist3'];
$artist4 = $_POST['artist3'];
$artist5 = $_POST['artist3'];
$song = $_POST['song'];
$song2 = $_POST['song2'];
$song3 = $_POST['song3'];
$song4 = $_POST['song3'];
$song5 = $_POST['song3'];
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$subject = Wedding;
$message = "
From: $visitor \n
Are they comming to the wedding?: $group1 \n
Dietary: $dietary \n
From: $visitor2 \n
Are they comming to the wedding?: $group2 \n
Dietary: $dietary2 \n
Artist1: $artist \n
Song1: $song \n
Artist2: $artist2 \n
Song2: $song2 \n
Artist3: $artist3 \n
Song3: $song3 \n
Artist4: $artist4 \n
Song4: $song4 \n
Artist5: $artist5 \n
Song5: $song5 \n
------------------CONTACT US FORM-----------------------------
Contact Us Name: $name \n
Contact Us Email part1: $email \n
Contact Us comments: $comments \n
";
$from = "From: $visitor\r\n";
mail("******@hotmail.com", $subject, $message, $from);
?>
<p align="center">
<script>location.href="thankyou.html";</script><BR>
<a href="thankyou.html"><b>The new Toshiba Mini NB300/NB305 Netbooks</b></a>
Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />
Attention: <?php echo $attn ?>
<br />
Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
<?php echo $ip ?>
<br /><br />
<a href="contact.php"> Next Page </a>
</p>
</body>
</html>