Script Garage

 

about php scripts.. i cant get it to work (html form)?

i have html form and submit and its posts to mailer.php... when i enter something and i hit submit and when the mailer.php page it just has the script.. how do i set this up to work? <script language="php"> $email = $HTTP_POST_VARS[email]; $mailto = "myemail@here.com"; $mailsubj = "Form submission"; $mailhead = "From: $email\n"; reset ($HTTP_POST_VARS); $mailbody = "Values submitted from web site form:\n"; while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); } </script>

Public Comments

  1. It shouldn't be <script language="php"> It should be <?php and where you have </script> it should end with ?> So it's like this <?PHP //your code ?>
  2. 1- your server should support the php language 2- the HTML and mailer.php should be in the same directory root
Powered by Yahoo! Answers