Page 1 of 1

email form problem

Posted: Wed Jul 20, 2005 6:37 pm
by tomE
Newbie with what is probably a simple mistake. Here is my email submission form.

Code: Select all

<?
$name=$_POSTї'name'];
$email=$_POSTї'email'];
$comments=$_POSTї'comments'];
$itemnumber=$_POSTїї'itemnumber'];
$to=&quote;me@me.com&quote;;
$message=&quote;$name 

has just filled in the contact form. This is what they had to say:

\n$comments\n$itemnumber\n\nTheir e-mail address was: $email&quote;;
if(mail($to,&quote;Form Submission&quote;,$message,&quote;From: $email\n&quote;)) {
header(&quote;Location: ht*p://www.xxxxxx/contact_redirect.html&quote;);
//-->
} else {
         echo &quote;There was a problem sending the mail. Please check that you filled in the form correctly.&quote;;
}
?>
</script>

(locally testing with IIS 5.1, php 4.3.4 and MS I.E 5) Result =

Code: Select all

Parse error: parse error, unexpected 'ї', expecting ']' in c:\inetpub\wwwroot\PHP\mail.php on line 5

This is the html form. I just want to check, does the input name have to be oneword to be posted via php?

Code: Select all

<form name=&quote;form1&quote; divalign=&quote;left&quote; method=&quote;post&quote; action=&quote;PHP/mail.php&quote;> 
                <p> 
                  <br>
                  <font color=&quote;#FFFFFF&quote; size=&quote;2&quote; face=&quote;Verdana, Arial, Helvetica, sans-serif&quote;>
<strong><font color=&quote;#333333&quote;>Name</font></strong></font><font color=&quote;#FFFFFF&quote;>..............................</font>
<font color=&quote;#FFFFFF&quote; size=&quote;2&quote; face=&quote;Verdana, Arial, Helvetica, sans-serif&quote;><strong><font color=&quote;#333333&quote;>Email Address</font>
</strong></font><font color=&quote;#FFFFFF&quote;>.......................</font><br>
                  <input name=&quote;Name&quote; type=&quote;text&quote; id=&quote;Name&quote; size=&quote;20&quote;>
                  <font color=&quote;#FFFFFF&quote; size=&quote;2&quote; face=&quote;Verdana, Arial, Helvetica, sans-serif&quote;>..</font> 
                  <input name=&quote;Email Address&quote; type=&quote;text&quote; id=&quote;Email Address2&quote; size=&quote;30&quote;>
                  <br>
                  <font color=&quote;#FFFFFF&quote;><br>
                  </font><font color=&quote;#333333&quote; size=&quote;2&quote; face=&quote;Verdana, Arial, Helvetica, sans-serif&quote;><strong>
				  eBay Item No:</strong></font><font color=&quote;3E424C&quote;>.</font>
				  <input name=&quote;itemnumber&quote; type=&quote;text&quote; id=&quote;itemnumber&quote; size=&quote;33&quote;>
                  <br>
                  <br>
                  <font color=&quote;#333333&quote; size=&quote;2&quote; face=&quote;Verdana, Arial, Helvetica, sans-serif&quote;><strong>Questions/Comments:</strong></font><br>
                  <textarea name=&quote;Questions/Comments&quote; cols=&quote;40&quote; rows=&quote;4&quote; id=&quote;Questions/Comments&quote;></textarea>
                  <br>
                  <br>
                  <font color=&quote;#F0D173&quote;><font color=&quote;#FFFFFF&quote;>......................... 
                  </font></font> 
                  <input name=&quote;from 'about_contact.html'&quote; type=&quote;submit&quote; id=&quote;from 'about_contact.html'&quote; value=&quote;E-mail Us&quote;>
                </p>
              </div>
            </form>
Also just wondering when i make a start on MYSQL can i just install it or is it best to unistall all the components then reinstall in a certain order?

Posted: Wed Jul 20, 2005 6:51 pm
by Burrito
change:

Code: Select all

$itemnumber=$_POST[['itemnumber'];
to:

Code: Select all

$itemnumber=$_POST['itemnumber'];
read the errors :P...

Posted: Wed Jul 20, 2005 7:26 pm
by tomE
sorry that was a typo its not actually in my script. so to clarify. please ignore the stupid mistake

Posted: Wed Jul 20, 2005 7:31 pm
by tomE
man am i on a stupid one today Sorry guys; but it is 1.20am UK. 8O

ok so i was reading the wrong script (see above) and after changing it i get

Code: Select all

Notice: Undefined index: email in c:\inetpub\wwwroot\PHP\candisel.php on line 3

Notice: Undefined index: comments in c:\inetpub\wwwroot\PHP\candisel.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\PHP\candisel.php:3) in c:\inetpub\wwwroot\PHP\candisel.php on line 12

Posted: Wed Jul 20, 2005 7:34 pm
by tomE
man am i on a stupid one today Sorry guys; but it is 1.20am UK. 8O

ok so i was reading the wrong script (see above) and after changing it i get

Code: Select all

Notice: Undefined index: email in c:\inetpub\wwwroot\PHP\candisel.php on line 3

Notice: Undefined index: comments in c:\inetpub\wwwroot\PHP\candisel.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\PHP\candisel.php:3) in c:\inetpub\wwwroot\PHP\candisel.php on line 12