NottaGuru Posted September 21, 2007 Share Posted September 21, 2007 Here is the problem... I a using a form with and when I go to validate the page at w3.org, I keep getting an error. Here is the error message... Line 143, Column 130: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag . …="2220e2191459ffd5fe7147301a0cdd77" /> The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element. One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>"). And the error code... <form id='ContactForm' action=' ' method='post'><input type="hidden" name="PHPSESSID" value="2220e2191459ffd5fe7147301a0cdd77" /> The actual code is... echo("$ErrorMessage </div> "); } ?> <form id='ContactForm' action='<?php $PHP_SELF ?>' method='post'> <table id='DepartmentTable' cellpadding='0' cellspacing='0' width='600px' border='0'> <tr> I noticed that on the validation code that my links are... <a href='../sitemap.php?PHPSESSID=6ee20bfa4b9389075a31651e6d521588'>Site Map</a> I used ini_set('session.use_trans_sid', false); to get rid of the session showing up in the address bar and it appears to work, but I can't get the error in my form to go away. I have tried echo-ing the form tag, changing the $PHP_SELF to contactus.php, putting the form inside the table. I am at a total loss here..... Thanks in advance. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 21, 2007 Share Posted September 21, 2007 because your php code isn't valid saying $PHP_SELF (Fyi that isn't a super global variable, you must define this the variable for the page it self is $_SERVER['self']) you have to echo something try this <?php echo $_SERVER['self'];?> instead of that php_self Quote Link to comment Share on other sites More sharing options...
NottaGuru Posted September 21, 2007 Author Share Posted September 21, 2007 Nope. Didn't work. I just tried. Still same error. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted September 21, 2007 Share Posted September 21, 2007 well because i didn't post on your error, I was stating you had another error, this error is irrelavent to php it is a xhtml compliance issue because you are trying to put an element inside somethign it can't be. Quote Link to comment Share on other sites More sharing options...
NottaGuru Posted September 21, 2007 Author Share Posted September 21, 2007 I'm not putting the input type='hidden' in my coding. Here is the code I am using... <form id='ContactForm' action='<?php echo $_SERVER['self'];?>' method='post'> <table id='DepartmentTable' cellpadding='0' cellspacing='0' width='600px' border='0'> And here is what the validator is showing... <form id='ContactForm' action='' method='post'><input type="hidden" name="PHPSESSID" value="ebbf15bd11e6164cf92410d80ee371b9" /> <table id='DepartmentTable' cellpadding='0' cellspacing='0' width='600px' border='0'> Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 21, 2007 Share Posted September 21, 2007 I don't think this is related to the PHP code...can you show a link to the live page? Quote Link to comment Share on other sites More sharing options...
NottaGuru Posted September 21, 2007 Author Share Posted September 21, 2007 Sure... Here is the link to the live page... www.yuchniuk.com/contactus.php Here is the link to the validator... http://validator.w3.org/ And here is a link to the actual coding... www.yuchniuk.com/contactus.txt Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 21, 2007 Share Posted September 21, 2007 I wonder if it's a session setting that is making it insert that there...cause that's weird. I've never seen anything like it. What are your settings for the session handling? ie, session.use_only_cookies, etc? Quote Link to comment Share on other sites More sharing options...
NottaGuru Posted September 21, 2007 Author Share Posted September 21, 2007 The only one I use is... ini_set('session.use_trans_sid', false); I'm not going to use cookies just yet. When I tried searching for help, I seen this code and it said it would remove the SID from the address bar and it said something else about cookies. I added these lines... ini_set('session.use_only_cookies', true); ini_set('url_rewriter.tags', ''); And still get the same error. The form is in a seperate page (along with the thank-you page). Here is the main page code... www.yuchniuk.com/contactus.txt and the form... www.yuchniuk.com/contactusform.txt Quote Link to comment Share on other sites More sharing options...
NottaGuru Posted September 21, 2007 Author Share Posted September 21, 2007 So what do I get for stumping everyone? Quote Link to comment Share on other sites More sharing options...
NottaGuru Posted September 21, 2007 Author Share Posted September 21, 2007 Any luck anyone? Quote Link to comment Share on other sites More sharing options...
dbo Posted September 21, 2007 Share Posted September 21, 2007 It said it was valid to me? Quote Link to comment Share on other sites More sharing options...
AdRock Posted September 21, 2007 Share Posted September 21, 2007 Says valid to me too Quote Link to comment Share on other sites More sharing options...
NottaGuru Posted October 1, 2007 Author Share Posted October 1, 2007 I figured out why it wasn't validating right for me... I had to add a no-cache meta and then refresh. Oops. Thanks for all the help everyone. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.