Jump to content

Recommended Posts

Posted

Hi there...

 

My php script requests data from the form:-

 

$name = $_REQUEST['name'] ;

$from = $_REQUEST['email'] ;

 

And then when I try to process the validation with:-

 

if($name == '') {print "You have not entered your name, please go back and try again.";}

else {

if($from == '') {print "You have not entered your email, please go back and try again.";}

else {

$send = mail($to, $subject, $body, $headers);

}

}

 

It fails as even when I enter data I get the error message regardless..

 

Pls advise..

Posted

Anyone..? I would have thought a seasoned php pro can see why my validation statement is ignored.

Basically even when the form field is populated, I see the alert to input the required data..

what gives..? I am new to php (obviously).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...