Проблем с валидацията

Gamerz

Registered
Може ли някой да поправи този файл много ще съм благодарен!!!

Код:
 <?include "includes/slideshow.php"?>

<table cellpadding="0" cellspacing="0" border="0">
<tr>
	<td style="width: 6px;"></td>
	<td>

		<table cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td></td>
		</tr>
		<tr>
			<td>

				<table cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td style="border-left: 1px solid #B6B6B6; border-right: 1px solid #B6B6B6;"></a></td>
				</tr>
				</table>
				
				<table cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td >

						<table cellpadding="0" cellspacing="0" border="0">
						<tr>
							<td width="33" align="center" style="padding-left: 1px;"><SPAN id="_Ath_FileName" style="padding: 0px;"></td>
							<td width="277" style="padding-left: 10px;"><SPAN class="featured" id="_Ath_Console" style="padding: 0px;"></td>
							<td width="167" align="center">

<table cellpadding="0" cellspacing="0" border="0" align="right">
                                  <td></td>
                                  <td></td>
                                  <td></td>
                                 </table>

<? // <a href="#"><img src="images/1.jpg" hspace="1" border="0"></a><a href="#"><img src="images/2.jpg" hspace="1" border="0"></a><a href="#"><img src="images/3.jpg" hspace="1" border="0"></a> ?>

</td>
						</tr>
						</table>

					</td>
				</tr>
				</table>

			</td>
		</tr>
		
		<tr>
			<td></td>
		</tr>
		<tr>
			<td><img src="images/spacer.jpg"></td>
		</tr>
		<tr>
			<td></td>
		</tr>
<?php
		$featured_news = mysql_query("SELECT * from ccms_news where featured='1' order by id desc limit 10");
		$c = 1;
		while ($row = mysql_fetch_assoc($featured_news)) {

		// <span class=\"contentlight\"> - "; echo days_ago($row[timestamp]); echo "</SPAN>

			$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]); 
			$title_seo = str_replace(' ', '-', $title_start);

			if($odd = $c%2 ) { 
				$style = "featured_bg1.jpg";
			} else { 
				$style = "";
			}

echo "		<tr>

			<td >

				<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\">
				<tr>
					<td width=\"1%\"><a href=\"story-$row[id]-$title_seo.html\"><img alt=\"$row[title]\" align=\"left\" src=\"thumbnailer.php?type=featured_news&image=$row[image]\" style=\"border: 1px solid #B6B6B6;\" width=\"130\" height=\"85\"></a></td>
					<td width=\"99%\" valign=\"top\" style=\"padding: 5px;\">\n";

					if ($row[platform]) {
echo "						<img src=\"images/consoles/$row[platform].gif\" align=\"right\">";
					}

echo "					<a href=\"story-$row[id]-$title_seo.html\" class=\"latest_news\">$row[title]</a><br />
					<SPAN class=\"latest_news\">$row[prev_news]</SPAN></td>
				</tr>
				</table>

			</td>
		</tr>\n\n";

		$c++;
		}

?>
		<tr>
			<td><img src="images/content_foot.gif"></td>
		</tr>
		<tr>
			<td><img src="images/spacer.jpg"></td>
		</tr>
		<tr>
			<td><img src="images/div_new.png"></td>
		</tr>
		<tr>
			<td background="images/latest_head_bg.jpg" height="26">

				<table cellpadding="3" align="center" cellspacing="0" border="0" width="465">
				<tr>
					<td width="51%"><SPAN class="latest_sub">Files</SPAN></td>
					<td width="49%"><SPAN class="latest_sub">Images</SPAN></td>
				</tr>
				</table>

			</td>
		</tr>
		<tr>
			<td width="100%">


				<table cellpadding="0" align="center" cellspacing="0" border="0" width="465">
				<tr>
					<td width="239" valign="top">

						<table cellpadding="0" align="center" cellspacing="0" border="0" width="239">
<?php
		$latest_files = mysql_query("SELECT * from ccms_file order by id desc limit 5");
		$c = 1;
		while ($row = mysql_fetch_assoc($latest_files)) {

			$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]); 
			$title_seo = str_replace(' ', '-', $title_start);
?>
						<tr>
							<td height="24" width="239" background="images/latest_left1.jpg" style="padding-left: 1px;">

								<table cellpadding="0" align="center" cellspacing="0" border="0" width="238">
								<tr>
									<td width="2%" style="padding-left: 4px;"><img hspace="4" src="images/aero2.gif"></td>
									<td width="73%"><a href="<?echo "file-$row[id]-$title_seo.html"?>" class="featured_list"><?

			$MAX_LENGTH = 25;
			$str = strlen($row[title]);

			if ($str <= $MAX_LENGTH) {
				echo "$row[title]";
			} else {

				$s2 = substr($row[title], 0, $MAX_LENGTH - 3);
				echo "$s2";
				echo "...";
			}
			?></a></td>
									<td width="25%" style="padding-right: 4px;"><center><SPAN class="featured_list"><strong><?php

			if ($row[timestamp] == "0") {
				echo $row[date];
			} else {
				echo check_today($row[timestamp]); // echo timedisplay($row[timestamp]);
			}
								?></strong></SPAN></td>
								</tr>
								</table>


							</td>
						</tr>
						<tr>
							<td><img src="images/latest_split1.jpg"></td>
						</tr>
<?php
		}
?>
						</table>

					</td>
					<td width="238" valign="top">

						<table cellpadding="0" align="center" cellspacing="0" border="0" width="238">
<?php
		$latest_images = mysql_query("SELECT DISTINCT title,date,cat_id,title,timestamp from ccms_screenshots ORDER BY id desc limit 5");
		$c = 1;
		while ($row = mysql_fetch_assoc($latest_images)) {

			$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]); 
			$title_seo = str_replace(' ', '-', $title_start);
?>
						<tr>
							<td height="24" width="237" background="images/latest_right1.jpg" style="padding-left: 1px;">

								<table cellpadding="0" align="center" cellspacing="0" border="0" width="237">
								<tr>
									<td width="2%" style="padding-left: 4px;"><img hspace="4" src="images/aero2.gif"></td>
									<td width="73%"><a href="<?echo "mediacat-$row[cat_id].html"?>" class="featured_list"><?

			$MAX_LENGTH = 25;
			$str = strlen($row[title]);

			if ($str <= $MAX_LENGTH) {
				echo "$row[title]";
			} else {

				$s2 = substr($row[title], 0, $MAX_LENGTH - 3);
				echo "$s2";
				echo "...";
			}
			?></a></td>
									<td width="25%" style="padding-right: 4px;"><center><SPAN class="featured_list"><strong><?php

			if ($row[timestamp] == "0") {
				echo $row[date];
			} else {
				echo check_today($row[timestamp]); // echo timedisplay($row[timestamp]);
			}
								?></strong></SPAN></td>

								</tr>
								</table>

							</td>
						</tr>
						<tr>
							<td><img src="images/latest_split2.jpg"></td>
						</tr>
<?php
		}
?>
						</table>
					</td>
				</tr>
				</table>

			</td>
		</tr>
		<tr>
			<td background="images/latest_head_bg.jpg" height="26">

				<table cellpadding="3" align="center" cellspacing="0" border="0" width="465">
				<tr>
					<td width="51%"><SPAN class="latest_sub">Articles</SPAN></td>
					<td width="49%"><SPAN class="latest_sub">Threads</SPAN></td>
				</tr>
				</table>

			</td>
		</tr>
		<tr>
			<td width="100%">

				<table cellpadding="0" align="center" cellspacing="0" border="0" width="465">
				<tr>
					<td width="239" valign="top">

						<table cellpadding="0" align="center" cellspacing="0" border="0" width="239">
<?php
		$latest_articles = mysql_query("SELECT * from ccms_article order by id desc limit 5");
		$c = 1;
		while ($row = mysql_fetch_assoc($latest_articles)) {

			$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]); 
			$title_seo = str_replace(' ', '-', $title_start);
?>
						<tr>
							<td height="24" width="239" background="images/latest_left1.jpg" style="padding-left: 1px;">

								<table cellpadding="0" align="center" cellspacing="0" border="0" width="238">
								<tr>
									<td width="2%" style="padding-left: 4px;"><img hspace="4" src="images/aero2.gif"></td>
									<td width="73%"><a href="<?echo "article-$row[id]-$title_seo.html"?>" class="featured_list"><?

			$MAX_LENGTH = 25;
			$str = strlen($row[title]);

			if ($str <= $MAX_LENGTH) {
				echo "$row[title]";
			} else {

				$s2 = substr($row[title], 0, $MAX_LENGTH - 3);
				echo "$s2";
				echo "...";
			}
			?></a></td>
									<td width="25%" style="padding-right: 4px;"><center><SPAN class="featured_list"><strong><?php

									if ($row[timestamp] == "0") {
										echo $row[date];
									} else {
										echo check_today($row[timestamp]); // echo timedisplay($row[timestamp]);
									}
									?></strong></SPAN></td>
								</tr>
								</table>

							</td>
						</tr>
						<tr>
							<td><img src="images/latest_split1.jpg"></td>
						</tr>
<?php
		}
?>
						</table>

					</td>
					<td width="238" valign="top">

						<table cellpadding="0" align="center" cellspacing="0" border="0" width="238">
<?php
		$latest_threads = mysql_query("SELECT title,timestamp,id from ccms_forums_thread ORDER BY id desc limit 5");
		$c = 1;
		while ($row = mysql_fetch_assoc($latest_threads)) {

			$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]); 
			$title_seo = str_replace(' ', '-', $title_start);
?>
						<tr>
							<td height="24" width="237" background="images/latest_right1.jpg" style="padding-left: 1px;">

								<table cellpadding="0" align="center" cellspacing="0" border="0" width="237">
								<tr>
									<td width="2%" style="padding-left: 4px;"><img hspace="4" src="images/aero2.gif"></td>
									<td width="73%"><a href="<?echo "thread-$row[id].html"?>" class="featured_list"><?

			$MAX_LENGTH = 25;
			$str = strlen($row[title]);

			if ($str <= $MAX_LENGTH) {
				echo "$row[title]";
			} else {

				$s2 = substr($row[title], 0, $MAX_LENGTH - 3);
				echo "$s2";
				echo "...";
			}
			?></a></td>
									<td width="25%" style="padding-right: 4px;"><center><SPAN class="featured_list"><strong><?php

			if ($row[timestamp] == "0") {
				echo $row[date];
			} else {
				echo check_today($row[timestamp]); // echo timedisplay($row[timestamp]);
			}

								?></strong></SPAN></td>
								</tr>
								</table>

							</td>
						</tr>
						<tr>
							<td><img src="images/latest_split2.jpg"></td>
						</tr>
<?php
		}
?>
						</table>
					</td>
				</tr>
				</table>

			</td>
		</tr>
		<tr>
			<td><img src="images/content_foot.gif"></td>

		</tr>

		<tr>
			<td><img src="images/spacer.jpg"></td>

		</tr>
		</table>

	</td>
</tr>
</table></center>
 
Liberate каза:
как няма да имаш проблем като си ни дал php код :lol:

Не е от PHP-то, ако си генерира правилен HTML се валидира.
Ама това по горе ще се валидира догодина.

Първо:
Не казваш какво валидираш. HTML, XHTML, CSS?
Няма doctype.
100 пъти по добре е с външен CSS.
Какво има в инклуднатото PHP?
На първо четене... тия таблици.. абсурд.

Код:
<td width="167" align="center">

<table cellpadding="0" cellspacing="0" border="0" align="right">

Само това ще даде 15 грешки някъде.

Направи го свястно,прочети това онова и като ти останат няколко грешки тогава питай.
 

Back
Горе