Page 1 of 1

triggering the form

Posted: Wed Apr 16, 2008 5:43 pm
by jamesalexander
good day!

here i am again....
i encounter this all the time...and i am using it too....

<form>
<input type = "text" name = "name" />
<input type = "submit" name = "register" value = "submit" />
</form>

<?php
if(isset($_POST['$register']))){
.....actions
}
?>
is there any way to trigger the form beside the isset thing that i used.....
thanks for the info appreciate it...

Re: triggering the form

Posted: Wed Apr 16, 2008 6:21 pm
by s.dot
Yeah, included a hidden variable. I call mine 'action'.

Code: Select all

<input type="hidden" name="action" value="doUpdate">
Then in PHP...

Code: Select all

if (!empty($_POST['action']))
{
    //code here
}
Of course I check the action against what it should be, too.

Code: Select all

if (!empty($_POST['action']) && ($_POST['action'] == 'doUpdate'))
{
    //code here
}

Re: triggering the form

Posted: Thu Apr 17, 2008 6:44 pm
by jamesalexander
thank you!
i going to try that one, appreciate it...