#1
  1. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,870
    Rep Power
    369

    Premature end of script headers - not sure why


    I have a form where user can fill out a form. Now on this particular page I have dynamically changed a hidden field with either a test drive or brochure request (using get param). I also have another get parameter called debug.

    I send all this info to a script.

    This script

    // sends data to our system
    // sends data to external system


    for debug i have lots of

    if (isset($_POST['debug]) {
    echo some rubbish
    }

    in case i want to see the output. (not sure if this is a good idea to let people see the output by doing debug?)

    Now when i run the landing page like so:

    www.domain.com/page.php?debug

    everything works fine. but when i do:

    www.domain.com/page.php?debug&type=brochure

    I get the error in my logs? If i remove the debug param, everything starts working fine again. not sure how to debug this?

    EDITED: i realise i have not given any php code but i am looking for suggestions on why it would not work
    Last edited by paulh1983; June 27th, 2013 at 09:55 AM.
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,696
    Rep Power
    6351
    You're using $_POST to get something which would be in $_GET, and the line you use is incorrect, but I assume both of those are...typos?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Dazed&Confused
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2002
    Location
    Tempe, AZ
    Posts
    501
    Rep Power
    127
    Does special logic run only if "type" is specified, or if it has that specific value?

    I'm not sure I've ever had that error happen so I'm not sure what'd cause it. Looking at the code for any anomalies will probably be my only way to help.
  6. #4
  7. Why so angry?
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jan 2004
    Posts
    1,945
    Rep Power
    898
    Originally Posted by paulh1983
    Now when i run the landing page like so:

    www.domain.com/page.php?debug

    everything works fine. but when i do:

    www.domain.com/page.php?debug&type=brochure

    I get the error in my logs? If i remove the debug param, everything starts working fine again
    You mean that

    www.domain.com/page.php?type=brochure

    loads correctly? What happens if you give debug a value?

    www.domain.com/page.php?debug=1&type=brochure

    Or did you mean to say it works if you remove the type param?
    Verify and sanitize ALL USER DATA.

    And, to steal a quote from jeremy, "Explain your problem instead of asking how to do what you decided was the solution." Chances are someone on the forums will know a better or more efficient way to do what you're trying to accomplish.

    Avatar: Stolen by me, shown to me by patrick.


IMN logo majestic logo threadwatch logo seochat tools logo