Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Junior Member Famous's Avatar
    Join Date
    Jun 2007
    Posts
    27
    Member #
    15431
    I'm trying to validate my page to strict XHTML 1.1 but I'm left with an error.

    Line 12, Column 328: document type does not allow element "input" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset" start-tag .
    ="24f04f6dd110cec37a2c0ba1132181ba" /><p><input type='hidden' name='ref' valu
    What is happening is the use of PHP sessions is automatically adding a new hidden input tag just after the form tag.

    Code:
    <form action='loginout.php?ref=/prose/index.php' method='post'><input type="hidden" name="PHPSESSID" value="24f04f6dd110cec37a2c0ba1132181ba" /><p><input type='hidden' name='ref' value='/prose/index.php' />
    Unforetunately this is outside the <p> and therefore invalid. Any ideas on how to fix this?
    Thanks in advance.
    Fancy a read? Pixelfiction.co.uk

  2.  

  3. #2
    Member
    Join Date
    Apr 2007
    Posts
    96
    Member #
    15165
    Quote Originally Posted by Famous
    What is happening is the use of PHP sessions is automatically adding a new hidden input tag just after the form tag.
    I do not believe PHP is doing what you are describing. I would think it is more likely some code you are using is putting in the hidden tag.
    Perhaps you are using a templating engine and it is putting in the hidden field?

  4. #3
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    By the by -- even if it were, you could just wrap the form in a div.

  5. #4
    Junior Member Famous's Avatar
    Join Date
    Jun 2007
    Posts
    27
    Member #
    15431
    Wrapping the form in a div produces the same error.

    I have researched and it is normal behaviour when sessions are being used without cookies. The PHP scripts automatically add the hidden input field, which is invalid XHTML as it is outside the <p> containing the rest of the form.
    Fancy a read? Pixelfiction.co.uk

  6. #5
    Member
    Join Date
    Apr 2007
    Posts
    96
    Member #
    15165
    Quote Originally Posted by Famous
    I have researched and it is normal behaviour when sessions are being used without cookies. The PHP scripts automatically add the hidden input field, which is invalid XHTML as it is outside the <p> containing the rest of the form.
    Well, I learned something new.
    http://bugs.php.net/bug.php?id=13472

    Perhaps you can disable tans-id. I know I would never want that behaviour, as I would want to simulate it myself by passing the session variable in the form by hand coding it, instead of relying on PHP to automatically do it.

  7. #6
    Junior Member Famous's Avatar
    Join Date
    Jun 2007
    Posts
    27
    Member #
    15431
    I agree, I'd prefer to do it manually.
    I also have the problem of not having access to my php.ini file.
    How would I declare this to be turned off at the start of the script
    Fancy a read? Pixelfiction.co.uk

  8. #7
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    PHP Code:
    ini_set('trans_id'false); 
    , in theory

  9. #8
    Junior Member Famous's Avatar
    Join Date
    Jun 2007
    Posts
    27
    Member #
    15431
    Huzzah. Fixed it.
    That didn't work so I typed it into google and discovered trans_id cannot be changed in the script. I discovered that by adding different code after sessionstart() the id from the urls was removed.

    PHP Code:
    ini_set ('url_rewriter.tags'''); 
    Thanks all
    Fancy a read? Pixelfiction.co.uk


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:03 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com