Jump to content

W3C Validation - can anyone help me solve the last of my problems?


herghost

Recommended Posts

Hi all,

 

I have this down from over 300 errors to 19!

 

Can you help me solve the rest as I am not sure how to go about it

 

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.fanjunky.com%2F&charset=(detect+automatically)&doctype=Inline&ss=1&outline=1&group=0&verbose=1&user-agent=W3C_Validator%2F1.654#line-199

<!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>

<?php
session_start();
include('include/database.php');

$query = "SELECT * FROM user ORDER BY userid DESC LIMIT 1";
$result = mysql_query($query) or die(mysql_error());
if ($result)
	{
		while ($r = mysql_fetch_array($result))
	{
		{
   				$userid = $r["userid"];
		}
	} 
	}
?>

<script type="text/javascript" src="include/prototype.js"></script>
<script type="text/javascript" src="include/scriptaculous.js? ¬ load=effects"></script>
<script type="text/javascript" src="include/modalbox.js"></script>



<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Welcome to fanjunky.com! - New Music - Bands- MP3 - Tickets - Tour Dates - The Latest Band =  

<?php $sql = "SELECT * FROM user WHERE userid = '$userid'";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
{
  		echo $row['bandname'];
	}
} 
?>
</title>

<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="default.css" rel="stylesheet" type="text/css" media="screen" />
</head>


<body>
<?php
include('include/header.php');

?>
<?php
if(isset($_GET['update']))
{

echo "<script type='text/javascript'>alert('Thank You For Registering, You May Now Login.')</script>";
    }
?>


<div id="page">
<div id="content">
	<div class="post greenbox">
		<div class="title">
			<h1>Welcome to fanjunky.com</h1>
		</div>
<div class="entry"> <img src="images/smalllogo.jpg" alt="" width="120" height="120" class="left" />
		  <p>Welcome to FanJunky.com! Your information portal for bands and artists. Please view the information on bands stored in our database, including band information, band members, pictures, tour dates, tickets and much more! </p>
			<p> </p>
			<p>We are a user generated content site, and we rely on you, the user to help us in listing bands! Each band only takes roughly 5 minutes to complete, so feel free to add information about any band or artist you like, including your own band! You can do this by clicking on the register button on the right of this paragraph.</p>
	  </div>
		<div class="btm">
			<div class="l">
				<div class="r">
					<p class="meta"> </p>
				</div>
			</div>
		</div>
	</div>
        <br/>


        <div class="post bluebox">
		<div class="title">
			<h1>latest band ---------------------
<?php 
$sql = "SELECT * FROM user WHERE userid = '$userid'";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
{
  	echo $row['bandname'];
	}
} 
?>
</h1>
	</div>
		<div class="entry">
		  <table width="100%" border="0">
                <tr>
                  <td width="21%"><a href="newprofile.php?userid=<?php 
			  $sql = "SELECT * FROM user WHERE userid = '$userid'";
			  $result = mysql_query($sql) or die(mysql_error());
			  while($row = mysql_fetch_array($result))
			{ 
			  	{  echo $row['userid'];
				}
			}
				?>"><img src="users/<?php 
			  $sql = "SELECT * FROM user WHERE userid = '$userid'";
			  $result = mysql_query($sql) or die(mysql_error());
			  while($row = mysql_fetch_array($result))
			{ 
			  	{  echo $row['userid'];
				}
			}
				?>/mainpic.jpg" alt="bandpic"/></a></td>
                    
                  <td width="79%">
			  <?php 
$sql = "SELECT * FROM bandmaininfo WHERE userid = '$userid'";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)){
{
  echo $row['summary'];
}
} 
?>
                  <p><a href="newprofile.php?userid=<?php $sql = "SELECT * FROM user WHERE userid = '$userid'";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)){
{
echo $row['userid'];
}
} 
?>" />View More</p></td>
                </tr>
              </table>
             


</div>
		<div class="btm">
			<div class="l">
				<div class="r">
					<p class="meta"> </p>
				</div>
			</div>
		</div>
	</div>
	<div class="two-columns">
		<div class="columnA">
			<div class="title red">
				<h2>sponsers</h2>
			</div>
			<div class="content">

<script type="text/javascript">
google_ad_client = "pub-1087428711969548";

google_ad_slot = "3081294343";
google_ad_width = 250;
google_ad_height = 250;

</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>


			</div>
		</div>
		<div class="columnB">
			<div class="title blue">
				<h2>Random Bands</h2>
			</div>
			<div class="content">
<?php 

$sql = "SELECT * FROM user ORDER BY RAND() LIMIT 10";
$result = mysql_query($sql ,$con);
while($myrow = mysql_fetch_array($result))
{
echo "<table width ='90%'>";
echo "<tr>";
echo "<td>";
echo  $myrow['bandname'];
echo "</td>";
echo "<td>";
echo  "<a href='newprofile.php?userid=";
echo $myrow['userid'];
echo "'>View</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
}
?>
                </div>
		</div>
		<div class="btm"> </div>
	</div>
</div>
<!-- end content -->
<!-- start sidebar -->
<div id="sidebar">
	<ul>
		<li>
	  <h2>Control panel</h2>
			<ul><form id="loginForm" name="loginForm" method="post" action="login-exec.php" />
  <table width="259" border="0" align="center" cellpadding="2" cellspacing="0">
    <tr>
      <td width="108"><b>Login</b></td>
      <td width="143"><input name="username" type="text" class="textfield" id="login" /></td>
    </tr>
    <tr>
      <td><b>Password</b></td>
      <td><input name="password" type="password" class="textfield" id="password" /></td>
    </tr>
  </table>
  <li><input name="Submit" type="image" value="Login" src="buttons/login.jpg" align="middle" width="150" height="80" /></li>
  <li><a href="reg.php" title="Register" onclick="
Modalbox.show(this.href, {title: this.title, width: 600}); return false;
"><img src="buttons/register.jpg" alt="Register" width="150" height="80" /></a>
</li>

</ul>

      <h2>Sponsers</h2>
			<ul>
				<li><script type="text/javascript"><!--
google_ad_client = "pub-1087428711969548";
/* 250x250, created 4/14/09 */
google_ad_slot = "6665679490";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></li>
			</ul>

</ul>
</div>
<!-- end sidebar -->
    <div id="sidebar1">
	<ul>
	  <li>
	  <h2>Browser</h2>
		  <ul>
		    <li>Best Viewed With</li>
		    <li><a href="http://www.mozilla.com"><img src="images/firefox.jpg" alt="firefoxlink" width="122" height="118" /></a></li>
				</ul>

      
		  </ul>


</div>
<!-- end sidebar -->
<!-- end sidebar -->
</div>
<!-- end page -->
<div style="clear: both;"> </div>
<?php

include('include/footer.php')
?>


</body>
</li>
</html>

Link to comment
Share on other sites

The validator is already telling you what the problems are - poor html markup. These are just some sloppy errors in the use of html.

 

You are invalidly nesting html tags /form elements within list elements.

 

You are using an ampersand instead of the ampersand symbol - utf does not like html special chars.

 

The style "tag" belongs in the head ... an inline "embedded" style " element" (not "tag") is permitted within a proper html tag, like <p style=""> or <ul style="">

 

 

Link to comment
Share on other sites

You tried to include the "<" character in your page: you should escape it as "<"

That's one.

 

Rest (mostly) seems to have the

<form action="search.php" method="get" name="search"/>

to blame for it.

You made a self closing form (/>) so it shouldn't have any contents? Bit strange since a form without at least one type of input element and a submit button is useless.

Others errors are I think from elements you thought of sticking into that empty form.

 

Do note, even if your page validates, it's still not following the w3 guidelines.. you're using a table for the header while it's obviously not tabular data.

Link to comment
Share on other sites

some obvoius ones

 

<li><input name="Submit" type="image" value="Login" src="buttons/login.jpg" align="middle" width="150" height="80" ></li> 
to 
<li><input name="Submit" type="submit" value="Login" src="buttons/login.jpg" width="150" height="80" ></li> 

<td width="143"><input name="username" type="text" class="textfield" id="login"></td>
to 
<td width="143"><input name="username" type="text" class="textfield" id="login" /></td>

 

there are others but just gop through and fix them one by one a lis generally only contains one element

 

<div>
<ul>
<li>item one</li>
<li>intem two</li>
<li>item three</li>
</ul>
</div>

 

etc and an open <ul> and closing </ul> should be between the <div> tags

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.