baylee
10-22-2006, 09:18 PM
Here is my code. It is supposed to email the page to the specified email address but it returns an error when I enter it into PhP.
<?php
$email = $HTTP_POST_VARS[email];
$mailto = "bayleewebb@bellsouth.net";
$mailsubj = "Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody =$_SERVER['REQUEST_URI'] . "." .$_SERVER['HTTP_USER_AGENT'] . "." . "$REMOTE_ADDR.".".Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$mailbody .= "$key : $val\n"; }
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>
Here is the error:
Error
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem
ERROR: Unknown Punctuation String @ 1
STR: <?
SQL: <?php
$email = $HTTP_POST_VARS[email];
SQL query:
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?php
$email = $HTTP_POST_VARS[email]' at line 1
<?php
$email = $HTTP_POST_VARS[email];
$mailto = "bayleewebb@bellsouth.net";
$mailsubj = "Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody =$_SERVER['REQUEST_URI'] . "." .$_SERVER['HTTP_USER_AGENT'] . "." . "$REMOTE_ADDR.".".Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$mailbody .= "$key : $val\n"; }
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>
Here is the error:
Error
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem
ERROR: Unknown Punctuation String @ 1
STR: <?
SQL: <?php
$email = $HTTP_POST_VARS[email];
SQL query:
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?php
$email = $HTTP_POST_VARS[email]' at line 1