www.webdeveloper.com
Results 1 to 5 of 5

Thread: PHP form post

Hybrid View

  1. #1
    Join Date
    Oct 2011
    Posts
    29

    PHP form post

    If I have the bellow html form...

    <form name="form_test" method="post" action="PHP_TEST.php">
    <input type="submit" value="Save" name="send_post_save"></input>
    <input type="submit" value="Delete" name="send_post_delete"></input>

    ...how can I set up my PHP_TEST.php page to differentiate if the sender was my 'Save' button or my 'Delete' button.

    Thanks

  2. #2
    Join Date
    Feb 2012
    Posts
    218
    PHP Code:
    if($_POST['send_post_save']){

    }
    elseif(
    $_POST['send_post_delete']){



  3. #3
    Join Date
    Feb 2012
    Location
    chennai
    Posts
    4
    you can also do it by javascript..by using onclick event handler and a common function for both buttons to handle the event

  4. #4
    Join Date
    Feb 2012
    Posts
    218
    Quote Originally Posted by insidioustrance View Post
    you can also do it by javascript..by using onclick event handler and a common function for both buttons to handle the event
    and if the user has disabled javascript... he sticks with the PHP way.

  5. #5
    Join Date
    Oct 2011
    Posts
    29
    Thanks hyperionXS, that worked great!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles