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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 ? |
|
|||
|
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) |