I have a form which for debugging I'm submitting as 'get' so that I can see the values of the inputs being passed.

the url pass is

AddMValidate.php?prodno=1682&isnew=on&special=on&title=Special&Mselect=SAM&FCKeditor1=dkja+sdfjasfd+adj+ashfkjdhaskj+fdh&submit=Submit

In my AddValidate.php page I have the following

#Validate that Machine Type has been selected
 
$Mselect = $_REQUEST["Mselect"];
 
if ($Mselect =="SAM")
 $Mesg .= "<li>You must select a <b>Machine Type</b>.</li>";

As you can see Mselect in the URL does = "SAM" but the validation statement above fails WHY?:sad:

I have a form which for debugging I'm submitting as 'get' so that I can see the values of the inputs being passed.

the url pass is

AddMValidate.php?prodno=1682&isnew=on&special=on&title=Special&Mselect=SAM&FCKeditor1=dkja+sdfjasfd+adj+ashfkjdhaskj+fdh&submit=Submit

In my AddValidate.php page I have the following

#Validate that Machine Type has been selected
 
$Mselect = $_REQUEST["Mselect"];
 
if ($Mselect =="SAM")
 $Mesg .= "<li>You must select a <b>Machine Type</b>.</li>";

As you can see Mselect in the URL does = "SAM" but the validation statement above fails WHY?:sad:

Silly question, but do you want SAM to be the only valid response? As written above, SAM will always return the error message, and anything else (even if MSelect is not specified) will continue silently. Syntactically, your code appears fine

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.