Click to See Complete Forum and Search --> : whats wrong with my code?


angomeka
02-08-2002, 12:35 PM
ok here is a simple mailing scipt i wrote and it use to work on my old server but now it doesnt. can ya tell me whats up.
------ form --------

<FORM METHOD='POST' ACTION='aff/signup.php'>
<table width='100%' border='0'>
<tr>
<td align='left' valign='top'>Name:</td>
<td align='right' valign='top'><INPUT TYPE='TEXT' NAME='full' SIZE=35 MAXLENGTH=60></td>
</tr>
<tr>
<td align='left' valign='top'>E-Mail Address:</td>
<td align='right' valign='top'><INPUT TYPE='TEXT' NAME='email' SIZE=35 MAXLENGTH=60></td>
</tr>
<tr>
<td align='left' valign='top'>Sites Name:</td>
<td align='right' valign='top'><INPUT TYPE='TEXT' NAME='name' SIZE=35 MAXLENGTH=60></td>
</tr>
<tr>
<td align='left' valign='top'>Sites Address:</td>
<td align='right' valign='top'><INPUT TYPE='TEXT' NAME='web' SIZE=35 MAXLENGTH=100 value='http://'></td>
</tr>
<tr>
<td align='left' valign='top'>How many hits do you get per month:</td>
<td align='right' valign='top'><INPUT TYPE='TEXT' NAME='month' SIZE=35 MAXLENGTH=100 value=''></td>
</tr>

<TR><td align='left' valign='top'> <INPUT TYPE='submit' VALUE='Send your link!'></td>
<td align='right' valign='top'> <input type='reset' value=' Clear-Form'></td></tr>
</table>
</form>

----- mailing script --------

<meta http-equiv="refresh" content="5;URL=http://www.animebin.com/thanks.php">
<?
//get all the inputs from all of the forms
$i=0;
if (!is_array($HTTP_POST_VARS))
return;
reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
$val=stripslashes($val);


//mail everything off to admin
"$key = $valn";
}
$mailto= "animebin@animebin.com";
$subject= "Affilate";
$from= "$email";
$full= "my name is: $full
My web site and be found at: $web
Sites name is: $name
I get $month hits a month";
mail( "$mailto", "$subject","$full", "From: $email");

?>
<?
//get all the inputs from all of the forms
$i=0;
if (!is_array($HTTP_POST_VARS))
return;
reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
$val=stripslashes($val);


//mail everything off to admin
"$key = $valn";
}
$sendto= "$email";
$subjectq= "Affilate";
$froms= "Anime Bin";
$letter= "Dear: $full at $email
If this address $web and sites name $name is correct then you should be getting and email from me stateing that you site had been added to my site. I must warn you that 1/10 sites make it to my links page. Also If your happends to be that one out of ten then you must be willing to add my sites link to web page. I mean it is only fair if your link is on my page that you will link to me. You should be getting a responce from me in about 1 to 3 days.
~Bin Staff.";
mail( "$sendto", "$subjectq","$letter", "From: Anime Bin");
?>

<b>Sending email please wait</b>

------------------
AMD ATHLON 800mhz
512 mb Ram pc133mhz
32mbddr Geforce 2 400mx
Sound Blaster Live!
8x Toshebia DVD
8x8x24 Yamaha burner
10/100 3com nic
30.6gb 7,200 rpm IDE Western Digital
8gb Maxtor

Grizzly
02-08-2002, 04:10 PM
How does it "not work?" Does the script come up with a parse error of any kind?

Or do you simply not get the mail? If you just don't get the mail, than it could be the case that the server administrator has the mail() function mis-configured, or doesn't have an available SMTP server.

angomeka
02-08-2002, 09:26 PM
Originally posted by Grizzly:
How does it "not work?" Does the script come up with a parse error of any kind?

Or do you simply not get the mail? If you just don't get the mail, than it could be the case that the server administrator has the mail() function mis-configured, or doesn't have an available SMTP server.

i am not getting the emails. It should have SMTP i have my email address threw them.


------------------
AMD ATHLON 800mhz
512 mb Ram pc133mhz
32mbddr Geforce 2 400mx
Sound Blaster Live!
8x Toshebia DVD
8x8x24 Yamaha burner
10/100 3com nic
30.6gb 7,200 rpm IDE Western Digital
8gb Maxtor

Grizzly
02-09-2002, 10:18 AM
Well, one way to test it would be to check what the mail() function is returning. The mail() function will return true if the mail was sent, and false if it was not. So try and see which boolean value the mail() function is returning.

That might be one way to start narrowing down the problem.

angomeka
02-09-2002, 12:00 PM
Originally posted by Grizzly:
Well, one way to test it would be to check what the mail() function is returning. The mail() function will return true if the mail was sent, and false if it was not. So try and see which boolean value the mail() function is returning.

That might be one way to start narrowing down the problem.

i will email my host about the smtp thing and see about that true flase deal thanks http://www.sharkyforums.com/ubb/biggrin.gif


------------------
AMD ATHLON 800mhz
512 mb Ram pc133mhz
32mbddr Geforce 2 400mx
Sound Blaster Live!
8x Toshebia DVD
8x8x24 Yamaha burner
10/100 3com nic
30.6gb 7,200 rpm IDE Western Digital
8gb Maxtor