one html form to call different functions in a single script

This is a discussion on one html form to call different functions in a single script within the PHP Language forums, part of the PHP Programming Forums category; I want to make a database script with several functions, such as adding entries, amending, listing etc. I know how ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-24-2005
charlie fortune
 
Posts: n/a
Default one html form to call different functions in a single script

I want to make a database script with several functions, such as
adding entries, amending, listing etc.

I know how to make a submit button call a php script, but not
particular functions within that script. I dont suppose I have to
write a mini script for each function ?
Reply With Quote
  #2 (permalink)  
Old 03-25-2005
Kenneth Downs
 
Posts: n/a
Default Re: one html form to call different functions in a single script

charlie fortune wrote:

> I want to make a database script with several functions, such as
> adding entries, amending, listing etc.
>
> I know how to make a submit button call a php script, but not
> particular functions within that script. I dont suppose I have to
> write a mini script for each function ?


Big question.

The simplest way to do this without any javascript is to have multiple
submit buttons. Try this code:

<?php echo "the value was: ".$_POST["subber"]; ?>
<form action="submits.php" method="post">
<button type="submit" name="subber" value="hiken">Hi Ken</button>
<button type="submit" name="subber" value="theval">The Value</button>
</form>

To find further tricks, suggest you read the HTML spec on the <button>
element, and read Netscape's material on javascript.

--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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




All times are GMT +1. The time now is 10:49 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0