Jump to content

WHY ME


Yuval200

Recommended Posts

:)I have a PHP system thingy, and I'm building the CP of it, now, this is the page HTML outpost:

<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />		<link rel="stylesheet" type="text/css" href="css.css" />		<script type="text/javascript" src="scripts.js"></script>		<script type="text/javascript" src="cpscripts.js"></script>		<style type="text/css">			#container_content {overflow: auto}		</style>		<!--[if IE]><style type="text/css">textarea {scrollbar-3dlight-color: white; scrollbar-arrow-color: black; scrollbar-darkshadow-color: white; scrollbar-face-color: white; scrollbar-highlight-color: white; scrollbar-shadow-color: white; scrollbar-track-color: white}</style><![endif]-->		<link rel="shortcut icon" href="favicon.png" />		<title>YuvPost! מערכת תגובות</title>	</head>	<body onkeyup="keylogoff(event)">		<div id="container">			<div id="container_nav">בחר פעולה:				<ul>					<li id="container_nav_home"><a href="main.php?page=admincp&action=main" class="plain">הדף הראשי של הפאנל</a>.</li>					<li><a href="main.php?page=admincp&action=cpmassage" class="plain">כתוב הודעת מנהל</a>.</li>					<li><a href="main.php?page=admincp&action=posts" class="plain">נהל הודעות</a>.</li>				</ul>				<a href="java script:void(0)" class="plain" id="logoff" onclick="confirmsg(1, 'main.php?page=admincp&action=logoff')">התנתק מפאנל הניהול</a>.			</div>			<div id="container_content">				<p>נהל את הודעות המערכת. ביכולתך לבחור בין שתי פעולות - מחיקה, ועריכה. כל ההודעות הקיימות מסודרות עפ"י המספר המזהה שלהן (post_id).</p>				<p>במידה והודעות מסויימות נצמאות בדף ההודעות (outpost.php) אך לא כאן. רענן את הדף על ידי לחיצה על Ctrl + R או על ידי לחיצה על הקישור <a href="java script:void(0)" onclick="location.reload()" class="script">הזה</a>.</p>				<table id="aposts_table">					<tr id="apost_data">						<th>מספר</th>						<th>שם</th>						<th>IP</th>						<th>תאריך</th>						<th>תוכן</th>						<th>פעולות</th>					</tr>					<tr valign="top" class="post">						<td class="post_id">#1</td>						<td class="post_by">יובל200</td>						<td class="post_ip"><span class="showtitle" title="כתובת IP לא זמינה">null</span></td>						<td class="post_date"><span class="showtitle" title="תאריך מלא: 15/11/2006 17:42">15/11/2006</span></td>						<td class="post_content">ריקון מקולל.תאריך ה�... <a href="java script: void(0)" onclick="open_popup('main.php?page=showpost&postid=1', 600, 250)" class="script" title="קרא את כל ההודעה">></a></td>						<td class="post_action">							<img src="post_edit.png" alt="ערוך" title="ערוך הודעה" onmouseover="this.style.cursor = 'pointer'" /> 							<img src="post_delete.png" alt="מחק" title="מחק הודעה" onclick="confirmsg(2, 'main.php?page=admincp&action=delete&postnum=1')" onmouseover="this.style.cursor = 'pointer'" />						</td>					</tr>					<tr valign="top" class="post">						<td class="post_id">#2</td>						<td class="post_by">יובל200</td>						<td class="post_ip"><span class="showtitle" title="כתובת IP לא זמינה">null</span></td>						<td class="post_date"><span class="showtitle" title="תאריך מלא: 15/11/2006 17:43">15/11/2006</span></td>						<td class="post_content">נסיון נוסף.<?php die(); ?&... <a href="java script: void(0)" onclick="open_popup('main.php?page=showpost&postid=2', 600, 250)" class="script" title="קרא את כל ההודעה">></a></td>						<td class="post_action">							<img src="post_edit.png" alt="ערוך" title="ערוך הודעה" onmouseover="this.style.cursor = 'pointer'" /> 							<img src="post_delete.png" alt="מחק" title="מחק הודעה" onclick="confirmsg(2, 'main.php?page=admincp&action=delete&postnum=2')" onmouseover="this.style.cursor = 'pointer'" />						</td>					</tr>					<tr valign="top" class="post">						<td class="post_id">#3</td>						<td class="post_by">יובל200</td>						<td class="post_ip"><span class="showtitle" title="כתובת IP לא זמינה">null</span></td>						<td class="post_date"><span class="showtitle" title="תאריך מלא: 15/11/2006 18:10">15/11/2006</span></td>						<td class="post_content">בובה, עכשיו יש גם אייקונים!... <a href="java script: void(0)" onclick="open_popup('main.php?page=showpost&postid=3', 600, 250)" class="script" title="קרא את כל ההודעה">></a></td>						<td class="post_action">							<img src="post_edit.png" alt="ערוך" title="ערוך הודעה" onmouseover="this.style.cursor = 'pointer'" /> 							<img src="post_delete.png" alt="מחק" title="מחק הודעה" onclick="confirmsg(2, 'main.php?page=admincp&action=delete&postnum=3')" onmouseover="this.style.cursor = 'pointer'" />						</td>					</tr>					<tr valign="top" class="post">						<td class="post_id">#4</td>						<td class="post_by">יובל200</td>						<td class="post_ip"><span class="showtitle" title="כתובת IP לא זמינה">null</span></td>						<td class="post_date"><span class="showtitle" title="תאריך מלא: 15/11/2006 18:18">15/11/2006</span></td>						<td class="post_content">English Test! Ahoy thar! HARHRHR.TEST... <a href="java script: void(0)" onclick="open_popup('main.php?page=showpost&postid=4', 600, 250)" class="script" title="קרא את כל ההודעה">></a></td>						<td class="post_action">							<img src="post_edit.png" alt="ערוך" title="ערוך הודעה" onmouseover="this.style.cursor = 'pointer'" /> 							<img src="post_delete.png" alt="מחק" title="מחק הודעה" onclick="confirmsg(2, 'main.php?page=admincp&action=delete&postnum=4')" onmouseover="this.style.cursor = 'pointer'" />						</td>					</tr>					<tr valign="top" class="post">						<td class="post_id">#5</td>						<td class="post_by">יובל200</td>						<td class="post_ip"><span class="showtitle" title="כתובת IP מלאה: 127.0.0.1">127.0</span></td>						<td class="post_date"><span class="showtitle" title="תאריך מלא: 30/11/2006 20:12">30/11/2006</span></td>						<td class="post_content">נסיון לבדיקת הגרשיים. ... <a href="java script: void(0)" onclick="open_popup('main.php?page=showpost&postid=5', 600, 250)" class="script" title="קרא את כל ההודעה">></a></td>						<td class="post_action">							<img src="post_edit.png" alt="ערוך" title="ערוך הודעה" onmouseover="this.style.cursor = 'pointer'" /> 							<img src="post_delete.png" alt="מחק" title="מחק הודעה" onclick="confirmsg(2, 'main.php?page=admincp&action=delete&postnum=5')" onmouseover="this.style.cursor = 'pointer'" />						</td>					</tr>				<tr>					<td colspan="6">						<strong>אם מידע מסויים לא נמצא בהודעה, הוא יראה כריק  או כ- "null".</strong>						<div id="orderby">							סדר הודעות עפ"י 							<select>								<option>מספר הודעה.</option>								<option>שם הכותב</option>								<option>כתובת IP.</option>								<option>תאריך</option>								<option>תוכן ההודעה</option>							</select>							בסדר  							<select>								<option <!--onclick="orderdata('asc')"-->>יורד.</option>								<option <!--onclick="orderdata('desc')"-->>עולה.</option>							</select>													</div>					</td>				</tr>			</table>			</div>		</div>		<p id="links">			לך:<br />			<a href="main.php?page=outpost" class="postlink">צפה בהודעות קיימות</a>.<br />			<a href="main.php?page=form" class="postlink">פרסם הודעה</a>.<br />			<a href="main.php?page=cplogin" class="postlink">התחבר לפאנל ניהול</a>.		</p>		<noscript>Javascript חייבת להיות מאופשרת להפעלת כל אופציות המערכת.<br /></noscript>		<div id="copyrights">			<p>YuvPost! גרסא 1.0. כל הזכויות שמורות <a class="normal" href="mailto:yuval_ritt@hotmail.co.il">ליובל200</a><sup style="font-size: x-small">©</sup>, "favicon" ואייקונים שונים ע"י <a class="normal" href="http://www.famfamfam.com" target="_blank">מארק ג'יימס</a>.</p>			<p><!--[if IE]>נצפה באופן הטוב ביותר עם <a class="normal" href="http://www.mozilla.com/firefox/" target="_blank">Mozilla Firefox</a>.<br /><![endif]--><span class="help"><a href="http://validator.w3.org/check/referer" target="_blank" class="normal">XHTML</a> ו- <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank" class="normal">CSS</a></span> תקני.</p>		</div>		<script type="text/javascript" src="jsstyling.js"></script>	</body></html>

(Ignore the hebrew..)Now, I really don't get it. The validator gives me errors like "cannot generate system identifier for general entity 'action'," "general entity 'action' not defined and no default entity," "reference not terminated by REFC delimiter."I've noticed that most of the errors are in URLs.. For now, there are like 22 validation errors for XHTML 1.0 Traditional..Can you please help me..?Thanks

Link to comment
Share on other sites

The "&" sign is used to call entities. However there's no &action entity in (X)HTML, which is why this fails validation. Turn &action into &action. The URL will still be the proper one and the validation will be it.

Link to comment
Share on other sites

Is there a way to change those & without doing it by hand (who knows how much of those I will need to replace)? I'm not talking about JS regex, because that will dinamicly change the page, but the source will stay the same.. Is there a good solution?

Link to comment
Share on other sites

Or perhaps a search&replace by an editor like Dreamwaver for example. It can search&replace stuff by regular expressions, so it's a good thing.

Link to comment
Share on other sites

Doing the search&replace thing via a program is problematic, because I'll have to redo it everytime the link is added, and since the posts are dynamic, it isn't that good.Aspnetguy, I know about the str_replace and the preg_replace functions, but how can I apply those to the whole document?

Link to comment
Share on other sites

Well, I wrote in my code (before any outpost was made):

function replace($buffer) {		$buffer = str_replace('&', '&', $buffer);				return $buffer;	}	ob_start(replace);

and in the end of my code:

ob_end_flush();

Now, two things:o The crappy function didn't replaced all those (&) in my text.o When replacing the & with it's entity, the urls are fine, but the a tags underline is scretched all over the line/td.Is it possible to fix this?Thanks :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...