Getting form information from $_POST
Posted 11 March 2006 - 12:34 PM
Quick question: Is there a way to determine the type of the form variable that is sent to PHP? Just as you can do:
foreach($_POST as $key => $value) to get the name and value, there must be a way to get other form info too. Or is there someplace with a better description of $_post. PHP manual is very vague here. Thanks
Posted 11 March 2006 - 01:18 PM
Oh, I forogot one thing. You may still be asking why I want the types, the reason is that I need to filter out the non-data elements like hidden, submit, button, reset, etc. And if the form elements contains information that needs to be entered as strings or int or decimal, I ned to know that to propertly format the query.
Posted 11 March 2006 - 01:30 PM
If the 'non-data' inputs had their names identifiable, e.g. all named ignore_[input name], you could skip over them in the loop where you retrieve the $_POST array keys/values. That would remove one problem. Hidden inputs need to be handled differently as they presumably exist for some post-submission processing purpose.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users