View previous topic :: View next topic |
Author |
Message |
datwig -
Joined: 26 Jan 2003 Posts: 85
|
Posted: Mon Feb 24, 2003 8:34 am Post subject: Help with a PHP script |
|
|
In the following script taken from http://www.pscode.com/, I recieved an "Notice: Undefined variable: submit in C:\Program Files\Abyss Web Server\htdocs\test\emailbomber.php on line 2" (now for the code):
<?php
if ($submit == "go!"){
$extra = "From: $from\r\nReply-To: $replyto\r\n";
echo "
<center><h1>Rio's Email Bomber</h1></center>
<table>
<tr>
<td>To:</td>
<td>$recipient</td>
</tr>
<tr>
<td>From:</td>
<td>$from</td>
</tr>
<tr>
<td>Reply-to:</td>
<td>$replyto</td>
</tr>
<tr>
<td>Subject:</td>
<td>$subject</td>
</tr>
<tr>
<td>Message:</td>
<td>$message</td>
</tr>
<tr>
<td>Number to send:</td>
<td>$number</td>
</tr>
</table>
<br>Sending... ";
for ($i = 0; $i < $number; $i++){
mail ($recipient, $subject, $message, $extra);
}
echo "done</body></html>";
}
else{
echo "
<center><h1>Rio's Email Bomber</h1></center>
<form method='post' action='emailbomber.php'>
<table>
<tr>
<td>To:</td>
<td><input type='text' name='recipient'></input></td>
</tr>
<tr>
<td>From:</td>
<td><input type='text' name='from'></input></td>
</tr>
<tr>
<td>Reply-to:</td>
<td><input type='text' name='replyto'></input></td>
</tr>
<tr>
<td>Subject:</td>
<td><input type='text' name='subject'></input></td>
</tr>
<tr>
<td>Message:</td>
<td><input type='text' name='message'></input></td>
</tr>
<tr>
<td>Number to send:</td>
<td><input type='text' name='number'></input></td>
</tr>
</table>
<input type='submit' name='submit' value='go!'></input>
</form> ";
}
?>
<br><center>Script designed & written by James Hall
can someone please tell me howto fix this. Thank you |
|
Back to top |
|
|
cactus_hugger -
Joined: 25 Feb 2003 Posts: 3
|
Posted: Tue Feb 25, 2003 2:29 am Post subject: |
|
|
It is simply a notice to tell you that you're using a variable without giving it a value first. You can turn off notices in the php.ini file:
error_reporting = E_ALL & ~E_NOTICE
Or you can do it in the PHP file itself:
error_reporting (E_ALL ^ E_NOTICE);
(The two examples turn on all error reporting except for notices.)
:D I had a bit of trouble with this too. _________________ "Give a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for a lifetime." |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
|
Back to top |
|
|
|