Connecting Tech Pros Worldwide Help | Site Map

one html form to call different functions in a single script

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:16 PM
charlie fortune
Guest
 
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 ?

  #2  
Old July 17th, 2005, 12:16 PM
Kenneth Downs
Guest
 
Posts: n/a
Default Re: one html form to call different functions in a single script

charlie fortune wrote:
[color=blue]
> 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 ?[/color]

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)
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

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 220,989 network members.