PDA

View Full Version : RE: Jubba "PHP Mail Form"



xzyfer
September 12th, 2003, 02:59 AM
hey jubba its a nice tutor but i think i have found some problems in your script that should realli be cleaned up to save confusion..
First..
mail ( string to, string subject, string message).
this is perfectly right but in you code you have done this...


mail($fromEmail, $Subject, $nMessage."\nFrom: ".$fromName."<".$fromEmail.">");

which to me is confusion and i belive it should have been $toMail from what i can make of your code..

second...
with your if(),you will generate an error that says that the varible $submit has not been initailized if teh button has not been pressed (whichh it usually isnt the first time you view it) and in some cases may not run the rest of the script...//
this should probably be replaced with
[PHP]
if (isset($submit)){
..your code here...
}
[PHP]
with this php will assume that the varible will be set later and supress the error..
well i hoped this help and that i havent made an idiot of myself..

Jubba
September 12th, 2003, 08:29 AM
yeah, I know the code is a little unclear because of the way I had originally set it up. I am too lazy to go back and change it right now. The whole thing is eventually going to be a real tutorial on www.kirupa.com and everything will be edited and correct then. :) thanks.