Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 24th, 2005, 12:50 AM
charlie fortune
Guest
 
Posts: n/a
Default is it possible to submit to a specific function inside another file

I want to use a form with several different possibilities of posting
to a single PHP program. Is there a way of telling the action not just
the name of the file, but which function to call with the information
?
  #2  
Old July 24th, 2005, 12:50 AM
Chris Morris
Guest
 
Posts: n/a
Default Re: is it possible to submit to a specific function inside another file

google@charliefortune.com (charlie fortune) writes:[color=blue]
> I want to use a form with several different possibilities of posting
> to a single PHP program. Is there a way of telling the action not just
> the name of the file, but which function to call with the information[/color]

<form action="script.php" method="post">
.....
<input type='submit' name='action1' value="Do Action 1">
<input type='submit' name='action2' value="Do Action 2">
<input type='submit' name='action3' value="Do Action 3">
.....
</form>

or

<form action="script.php" method="post">
.....
<input type='submit' name='action' value="Do Action 1">
<input type='submit' name='action' value="Do Action 2">
<input type='submit' name='action' value="Do Action 3">
.....
</form>

Use either the name or the value (or both) of the submit variable to
work out what to do in the script.

--
Chris
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles