SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict amy.damnit's Avatar
    Join Date
    Sep 2009
    Posts
    336
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Page loading as "Submitted"

    I have a page (i.e. "PAGE 1") with an HTML Form that contains an "Add To Cart" button.

    After clicking on the button, I am taken to another page (i.e. "PAGE 2") that also contains an HTML Form.

    However, PAGE 2 is loading up as "submitted" before I do anything?!

    How is that possible???


    Amy

  2. #2
    Visible Ninja bronze trophy
    JeffWalden's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,709
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Amy,

    What do you mean it's loading as submitted? Are you checking to see if a variable is set? (probably the submit button from the previous page)

    Check to make sure that what you're using to determine if the 2nd page is submitted or not isn't unintentionally being set on the first page. If you can provide me with your source code I'd be happy to take a look.
    TAKE A WALK OUTSIDE YOUR MIND.

  3. #3
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,622
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    If the form elements have the same name="" value on the forms and your using PHP to check if they were set then of course they are going to be set logically and its going to load up as submtited.

    Thoguh this is just a guess as I don't have the HTML for the forms .
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  4. #4
    SitePoint Addict amy.damnit's Avatar
    Join Date
    Sep 2009
    Posts
    336
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    If the form elements have the same name="" value on the forms and your using PHP to check if they were set then of course they are going to be set logically and its going to load up as submtited.

    Thoguh this is just a guess as I don't have the HTML for the forms .
    I'm using

    <!-- HIDDEN INPUT -->
    <input type="hidden" name="submitted" value="TRUE" />

    on both forms.

    But why should that matter?


    Amy

  5. #5
    SitePoint Addict amy.damnit's Avatar
    Join Date
    Sep 2009
    Posts
    336
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanReese View Post
    If the form elements have the same name="" value on the forms and your using PHP to check if they were set then of course they are going to be set logically and its going to load up as submtited.

    Thoguh this is just a guess as I don't have the HTML for the forms .
    Some points...

    1.) When you leave a page, all avriables (are supposed to) go out of scope

    2.) So have the same "name" doesn't matter

    3.) And when I load PAGE 2, my echo (yes, it is technically a PHP page, but still an XHTML form) is showing...

    submitted = TRUE


    Amy


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
  •