niche Posted July 19, 2010 Share Posted July 19, 2010 I've worked this validation down to 4 errors that I'm not able to resolve. Here's the URL: http://www.lincolnsrealdeals.com/ontop4.phpPlease check the HTML validation and let me know if you can help.ThanksHere's my script: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="description" content="Save money" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>savebop </title><style type="text/css">body{font-family:arial;}a{color:black;text-decoration:none;font-size:150%; width:200px;}a.one:visited {color:blue;}a.one:hover {color:red;}table.menu{font-size:75%;visibility:hidden;}</style><script type="text/javascript">function showmenu(elmnt){document.getElementById(elmnt).style.visibility="visible";}function hidemenu(elmnt){document.getElementById(elmnt).style.visibility="hidden";}</script><script type="text/javascript">var timer;function scrolltop(){document.getElementById('scrollmenu').style.top=document.body.scrollTop;timer=setTimeout("scrolltop()",1);}function stoptimer(){clearTimeout(timer);}</script><style type="text/css">input.one{color:blue}input.one:hover{color:red;}</style></head><body onload="scrolltop()" onunload="stoptimer()"><?phpinclude_once "connect_to_mysql.php";$result = mysql_query("SELECT * FROM plan") or die(mysql_error()); $rows = mysql_num_rows($result);//$_SESSION['num'] = null;$top = 100; $counter = 0;//echo '<form action="mailto:youremail@email.com" method="post" >';echo '<form action="temp1002b.php" method="post" >';while($row = mysql_fetch_array( $result )) { //echo '<div style="border:5px solid gray;position:absolute;background-color:'.$row['logo'].';left:340px;top:'.$top.'px;width:230;height:200;" </div>';// echo '<input style="position:absolute;left:240px;top:'.$top.'px;" type="checkbox" name="item'.$counter.'" id="$num" value="'.$row['id'].'" >'; echo '<div style="position:absolute;left:750px;top:'.$top.'px;" > <p>$' . $row['curwipprice']. '</p></div>';$top = $top + 18; echo '<input style="position:absolute;left:675px;top:'.$top.'px;"type="checkbox" name="item'.$row['id'].'" value="'.$row['id'].'" />'; //echo '<img style="position:absolute;left:340px;top:'.$top.'px;" src="'.$row['pic'].'"/>'; //echo '<div style="position:absolute;left:240px;top:'.$top.'px;" > <p>' . $row['curwipprice']. '</p>//<input style="position:absolute;left:0px;top:'.$top.'px;"type="checkbox" name="item'.$row['id'].'" value="'.$row['id'].'" > </div>'; // echo '<img style="position:absolute;left:340px;top:'.$top.'px;" src="'.$row['pic'].'"/>'; $top = $top + 50; $counter = $counter + 1;} //$top = $top + 200;echo '<span id="scrollmenu" style="position:absolute">';include_once 'nav5d.html';echo '<input class="one" target="_blank" style="position:absolute;left:111px;top:390px;border:none;background:transparent;font-size:150%;cursor:pointer;" type="Submit" value="Print Selections" />';echo '</span>';//echo '<input class="one" target="_blank" style="color:#0000ff;position:absolute;left:111px;top:290px;border: none; background: transparent;font:bold;font-size:150%;cursor:pointer"type="Submit" //value="Print Selections" />';//echo '<input style="position:absolute;left:240px;top:'.$top.'px;"type="Submit" value="Get Bopped" />';echo '</form>';session_start();$_SESSION['options'] = $counter +1; $_SESSION['user'] = 'niche@neb.rr.com';$_SESSION['timestamp'] = time();$_SESSION['time'] = date("Gis");$_SESSION['hour'] = date("G");$_SESSION['ampm'] = date("a");$_SESSION['date'] = date("y-m-d");$_SESSION['dd'] = date("j");$_SESSION['mm'] = date("n");$_SESSION['yy'] = date("y");$_SESSION['dow'] = date("N");$_SESSION['woy'] = date("W");$_SESSION['doy'] = date("z");$var = $_SESSION['user'];//echo $var;//echo '</br>';$var = $_SESSION['options'];//echo $var;$_SESSION['timestamp'] = time();include_once "connect_to_mysql.php";//$result = mysql_query("SELECT * FROM plan") or die(mysql_error()); mysql_query("UPDATE plan SET curref = curref + 1");?></body></html> Link to comment Share on other sites More sharing options...
thescientist Posted July 19, 2010 Share Posted July 19, 2010 1 + 2) you can only have one DTD per page. You have two. same goes for the name spacing. <html xmlns.....> part.3) target is deprecated in XHTML4) use "submit" (no capital)---5) use a strict DTD 6) avoid using inline styles and use an external stylesheet to better separate style and markup(those are my errors for your page) Link to comment Share on other sites More sharing options...
niche Posted July 19, 2010 Author Share Posted July 19, 2010 1 + 2) you can only have one DTD per page. You have two. same goes for the name spacing. <html xmlns.....> part.This is my DTD: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">Right? If so, what's the second doctype it's complaining about? Link to comment Share on other sites More sharing options...
dsonesuk Posted July 19, 2010 Share Posted July 19, 2010 in your include_once 'nav5d.html'; you should strip out everything except what is BETWEEN body tags, any scripting, css coding should be inserted in to the main page, but preferably in an external file, and then link to these external files. Link to comment Share on other sites More sharing options...
niche Posted July 19, 2010 Author Share Posted July 19, 2010 So, the second DTD came from the DTD in nav5d.php in the script:include_once 'nav5d.html';? Link to comment Share on other sites More sharing options...
dsonesuk Posted July 19, 2010 Share Posted July 19, 2010 Yep! afraid so.there should only be one (highlander moment there) dtd html head body etc. you should only include html tagging elements from within the body only! if you are inserting into the body of another page. Link to comment Share on other sites More sharing options...
niche Posted July 19, 2010 Author Share Posted July 19, 2010 Thanks!Few more questions. What exactly is a highlander moment?When I commented-out: include_once 'nav5d.html'; and changed target to submit, I still get two errors.thescientist said changing target to submit would fix the problem.What else needs to be changed? Link to comment Share on other sites More sharing options...
dsonesuk Posted July 19, 2010 Share Posted July 19, 2010 Highlander movie Christopher lambert, sean connery, cutting peoples heads off with swords, "there can only be one" was what they say.No! change submit back to target="_blank" scientist was not strictly (pun intended) correct, STRICT document does not use target, transitional does! so you are fine using that.and change submit to lowercase in<input style="position:absolute;left:240px;top:'.$top.'px;"type="submit" value="Get Bopped" /> Link to comment Share on other sites More sharing options...
niche Posted July 19, 2010 Author Share Posted July 19, 2010 Down to one error: there is no attribute "target"I think this is the offending script: echo '<input class="one" target="_blank" style="position:absolute;left:111px;top:390px;border:none;background:transparent;font-size:150%;cursor:pointer;" type="submit" value="Print Selections" />'; Link to comment Share on other sites More sharing options...
dsonesuk Posted July 19, 2010 Share Posted July 19, 2010 sorry i must be getting tired target attribute is not used in input. form, frame yes, so removing ref to target from input should correct this.if you want to use target="_blank" place it inecho '<form action="temp1002b.php" method="post" target="_blank" >'; Link to comment Share on other sites More sharing options...
niche Posted July 19, 2010 Author Share Posted July 19, 2010 Removing target="_blank" turns one error into twenty (see new validation of: http://www.lincolnsrealdeals.com/ontop4.php Link to comment Share on other sites More sharing options...
dsonesuk Posted July 19, 2010 Share Posted July 19, 2010 but adding space between style="....."type="..." might fix it. Link to comment Share on other sites More sharing options...
niche Posted July 19, 2010 Author Share Posted July 19, 2010 That script is commented out.This is the problem script. I changed this:echo '<input class="one" target="_blank" style="position:absolute;left:111px;top:390px;border:none;background:transparent;font-size:150%;cursor:pointer;" type="submit" value="Print Selections" />';to this:echo '<input class="one" style="position:absolute;left:111px;top:390px;border:none;background:transparent;font-size:150%;cursor:pointer;" type="submit" value="Print Selections" />'; Link to comment Share on other sites More sharing options...
dsonesuk Posted July 19, 2010 Share Posted July 19, 2010 you have ten input boxes with code such as below, i've taken this from your source<input style="position:absolute;left:675px;top:730px;"type="checkbox" name="item" value="" />notice the style="blah, blah"LOOKNOSPACEtype="blah, blah"should be<input style="position:absolute;left:675px;top:730px;" type="checkbox" name="item" value="" />notice the style="blah, blah" type="blah, blah" can you see it now! space yes!i know this is the problem cause i corrected it and it passed.this is the offending lineecho '<input style="position:absolute;left:675px;top:'.$top.'px;"type="checkbox" name="item'.$row['id'].'" value="'.$row['id'].'" />';should beecho '<input style="position:absolute;left:675px;top:'.$top.'px;" type="checkbox" name="item'.$row['id'].'" value="'.$row['id'].'" />'; Link to comment Share on other sites More sharing options...
niche Posted July 19, 2010 Author Share Posted July 19, 2010 I'm continually impressed by the attention to detail in replies. I'm also, too frequently, embarrassed by my lack of attention to detail. This is the hardest learning I've ever had to do. Learning that would be impossible without the help of dsonesuk and thescientist.Thanks,Niche Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.