FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » test if $_POST variable is set
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: test if $_POST variable is set [message #175833 is a reply to message #175831] Sat, 29 October 2011 13:04 Go to previous messageGo to previous message
Richard Damon is currently offline  Richard Damon
Messages: 58
Registered: August 2011
Karma:
Member
On 10/29/11 1:40 AM, cerr wrote:
> Hi There,
>
> I have a form with various checkboxes, they got names i have from a db
> to identify them.
> Now I would like to check what has been posted by the form. For that I
> would like to read all the field names from the db and check if they
> have been set something like this:
>
> $result = mysql_query("SELECT * FROM specialty");
> while($row = mysql_fetch_array($result)) {
> if (isset($_POST[$row['name']])) {
> var_dump($POST);
> session_unset();
> }
>
> But this doesn't seem to work the way I expected it to? I.e. I would
> liek to check if $_POST['MyCheckbox'] is set now but MyCheckbox is a
> name from the database. How do I do this best, the easiest way?
>
> Thanks,
> Ron

have you looked at using fetch_assoc / foreach?

is in:

while($row - mysql_fetch_assoc($result){
foreach($row as $key => $value){
//..
}
}
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: `********AMAZING HOT PHOTOS & VIDEOS ********
Next Topic: Suche Buch zur OOA/OOD
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 01 20:31:52 GMT 2024

Total time taken to generate the page: 0.03957 seconds