SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2006
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $SERVER POST[PHP SELF] doc flow

    I seem to have this recurring problem with my scripts when I'm using the phpself post method with my forms.
    My entire document is being parsed before the user has a chance to enter any data into the forms.
    It's a bit frustrating... I've been handling it by just breaking my code down into a ridiculous number of segments and passing the data from one file to the next, but that hardly seems like a habit I'd like to continue.
    Does anyone know what's going on here? Would you like to help a newbie out (yet again?)
    Last edited by cereal_girl; Aug 24, 2006 at 22:38.

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not really sure what you mean. maybe this will help you.

    have the form submit to itself.
    PHP Code:
    if (count($_POST)) {
        
    // a form was submitted, lets process
        
    if (processing successful) {
            
    // submission was good.
            // send http header to send them to next page
        
    } else {
             
    // processing failed.
             // show errors, and form to let them try again
        
    }
    } else {
        
    // form not submitted. show them the form.



Bookmarks

Posting Permissions

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