triggering the form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jamesalexander
Forum Newbie
Posts: 5
Joined: Wed Mar 26, 2008 10:35 pm

triggering the form

Post 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...
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: triggering the form

Post 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
}
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
jamesalexander
Forum Newbie
Posts: 5
Joined: Wed Mar 26, 2008 10:35 pm

Re: triggering the form

Post by jamesalexander »

thank you!
i going to try that one, appreciate it...
Post Reply