Results 1 to 2 of 2

Thread: Run a POST script

  1. #1

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Run a POST script

    How do i make it so that i dont trigger a POST action on a page.

    For example, i have a home page, that has links on it to other web pages of mine, one will be "update part", that page has a POST script in it, and for some reason it runs everytime i go to that page from another page, and i dont want it to.

    I wanted the user to be able to go to the "update part" page, then hit a button to update a part, and thats when it will run the POST script.

    Any ideas?

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Run a POST script

    make sure the user is posting a form to it.

    PHP Code:
    <?php
      
    //normal code stuff

      
    if($_SERVER['REQUEST_METHOD'] == "POST"){
        
    //anything in here will be executed upon posting to this script
      
    }else{
        
    //anything in here will only be executed if you are NOT posting to this script
      
    }
    ?>

Posting Permissions

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



Click Here to Expand Forum to Full Width