PHP help please!

Discussion in 'Programming' started by SearchBliss, May 18, 2009.

  1. #1
    I know ASP, not PHP.

    That being said, I have a PHP script that works fine after I post user input, however, the script runs when the page loads before the user input can be submitted...so I get an error. How do I prevent the code from running before the user input is posted?

    Thank you to anyone who can help.
     
    SearchBliss, May 18, 2009 IP
  2. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Hi,

    you have to check $_POST array using simple if statement:
    
    if ($_POST){
    /*
    your code here
    */
    }
    
    PHP:
    Regards
     
    koko5, May 19, 2009 IP
  3. SearchBliss

    SearchBliss Well-Known Member

    Messages:
    1,899
    Likes Received:
    70
    Best Answers:
    2
    Trophy Points:
    195
    Digital Goods:
    1
    #3
    Thanks, I used:
    
    if (isset($_POST['curl'])
    {
    
    Code (markup):
    And it worked great, thanks!
     
    SearchBliss, May 19, 2009 IP