agent007
January 10th, 2002, 19:07
Okay, I'm trying to make a feedback script where visitors can submit feedback to me using a form. I'm trying to use the forms to pass several variables ($name, $email, etc. etc.) to another script (submit.php) but it's not working. Here's my form code:
<form action="submit.php?name=<?=$name;?>&email=<?=$email;?>" method="POST">
<table border="0" cellspacing='0' cellpadding='0'>
<tr>
<td>
<b>Name/Alias:</b>
</td>
<td>
<input type="text" name="name" value="">
</td>
</tr>
<tr>
<td>
<b>Email:</b>
</td>
...
other form stuff goes here...
...
</td>
</tr>
<tr>
<td>
<input type=submit value="Submit" name="sfeedback">
</td>
</tr>
</table>
</form>
And here's the code for my submit.php script:
<?
if (empty($name) or ($name == "name")) {
echo "Make sure you fill out your name!";
}
if (empty($email) or ($email == "email")) {
echo "Make sure you fill out your email!";
}
else {
$sendto = "agent@mapcentral.ne.gs";
$content = "content will go here once I figure out how to pass the variables.";
$subject = "[MAPCENTRAL] Submission";
$header = "From: $email";
mail($sendto, $subject, $content, $header);
echo "Thanks, <b><a href=\"mailto:<?=$email;?>\"><?=$name;?></a></b>, your feedback has been sent. Here's what you entered:<BR>
<table cellspacing='0' cellpadding='0' border='0'>
<tr>
<td>
<b>Name/Alias:</b>
</td>
<td>
<?=$name;?>
</td>
</tr>
<tr>
<td>
<b>Email:</b>
</td>
<td>
<?=$email;?>
</td>
...
other form stuff goes here...
...
</tr>
</table>
";
}
?>
Any ideas? I'm not getting any parse errors or any other kind of error. It's just not passing the variables. When I click submit, the address bar doesn't show that it has added the variables in. Ex, it shows: submit.php?name=&email= instead of submit.php?name=myname&email=myemail@something.com. Any ideas?
EDIT: Of course, the "other form stuff..." thing has some other text boxes, but it shouldn't make any difference.
<form action="submit.php?name=<?=$name;?>&email=<?=$email;?>" method="POST">
<table border="0" cellspacing='0' cellpadding='0'>
<tr>
<td>
<b>Name/Alias:</b>
</td>
<td>
<input type="text" name="name" value="">
</td>
</tr>
<tr>
<td>
<b>Email:</b>
</td>
...
other form stuff goes here...
...
</td>
</tr>
<tr>
<td>
<input type=submit value="Submit" name="sfeedback">
</td>
</tr>
</table>
</form>
And here's the code for my submit.php script:
<?
if (empty($name) or ($name == "name")) {
echo "Make sure you fill out your name!";
}
if (empty($email) or ($email == "email")) {
echo "Make sure you fill out your email!";
}
else {
$sendto = "agent@mapcentral.ne.gs";
$content = "content will go here once I figure out how to pass the variables.";
$subject = "[MAPCENTRAL] Submission";
$header = "From: $email";
mail($sendto, $subject, $content, $header);
echo "Thanks, <b><a href=\"mailto:<?=$email;?>\"><?=$name;?></a></b>, your feedback has been sent. Here's what you entered:<BR>
<table cellspacing='0' cellpadding='0' border='0'>
<tr>
<td>
<b>Name/Alias:</b>
</td>
<td>
<?=$name;?>
</td>
</tr>
<tr>
<td>
<b>Email:</b>
</td>
<td>
<?=$email;?>
</td>
...
other form stuff goes here...
...
</tr>
</table>
";
}
?>
Any ideas? I'm not getting any parse errors or any other kind of error. It's just not passing the variables. When I click submit, the address bar doesn't show that it has added the variables in. Ex, it shows: submit.php?name=&email= instead of submit.php?name=myname&email=myemail@something.com. Any ideas?
EDIT: Of course, the "other form stuff..." thing has some other text boxes, but it shouldn't make any difference.