Jump to content
Larry Ullman's Book Forums

Script 2.4 in 5th Edition


Recommended Posts

Hi Everyone,

Just curious. I'm looking at the gender part of this script and it has a elseif nested in a if else lines 45 - 57. Is there a reason for the nested else?

The returned statement says "Gender should be either M or F!" but there's no discernible way to select anything other than M or F.

 

Thanks!

 

Link to comment
Share on other sites

Ah! Good question! The reason is because we don't want to assume the data will come from the form or in an unadulterated way. It'd be really easy to submit data from elsewhere to this script or to modify the form in the browser and then submit that. So these conditionals provide an extra layer of security.

Link to comment
Share on other sites

 Share

×
×
  • Create New...