Help with a PHP script

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
datwig
-


Joined: 26 Jan 2003
Posts: 85

PostPosted: Mon Feb 24, 2003 8:34 am    Post subject: Help with a PHP script Reply with quote

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 View user's profile Send private message AIM Address
cactus_hugger
-


Joined: 25 Feb 2003
Posts: 3

PostPosted: Tue Feb 25, 2003 2:29 am    Post subject: Reply with quote

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 View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue Feb 25, 2003 2:35 am    Post subject: Re: Help with a PHP script Reply with quote

Please read http://www.aprelium.com/forum/viewtopic.php?t=85 .
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group