Hallo!
Ich arbeite gerade an einer Seite und möchte diese auch validiert schreiben. Allerdings frage ich mich ob dies überhaupt möglich ist, wenn man mit der $_GET[] methode arbeitet. Es werden immer Fehlermeldungen wegen der Url erzeugt. Dies benötige ich allerdings wegen dem $_GET...
Hier ein Beispiel von meiner erzeugten Seite:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Timeout</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript">
<!--
function popup(adress,winname,w,h)
{
window.open(adress,winname,'toolbar=no,resizable=yes,status=no,menubar=no,width=' + w + ',height='+ h);
}
//-->
</script>
<!--
Example Link
<a href="#" onClick="popup('asfd.php','asdfasdfasdf',400,400)">asdf</a>
//--></head>
<body>
<div id="container">
<div id="title">
<img src="images/timeout_logo.jpg" style="float:right;margin-left:3px;" alt="Logo - Timeout" />
<p>Willkommen <span class='wichtig'>admin</span> im</p>
<h1><span class="first">A</span>dmin <span class="first">C</span>ontrol <span class="first">P</span>anel</h1> </div> <div id="left">
<div class="menucontainer">
<p class="menutitle">Usermanagement</p>
<a class="menu" href="start.php?action=create_user&">Benutzer erstellen</a>
<a class="menu" href="start.php?action=user_edit&">Benutzer bearbeiten</a>
<a class="menu" href="start.php?action=user_edit_profile&">Profil bearbeiten</a>
</div>
<div class="menucontainer">
<p class="menutitle">MENU 2</p>
<a class="menu" href="#">Hyperlink 1</a>
<a class="menu" href="#">Hyperlink 2</a>
<a class="menu" href="#">Hyperlink 3</a>
<a class="menu" href="#">Hyperlink 4</a>
<a class="menu" href="#">Hyperlink 5</a>
</div>
<div class="menucontainer">
<p class="menutitle">MENU 3</p>
<a class="menu" href="#">Hyperlink 1</a>
<a class="menu" href="#">Hyperlink 2</a>
<a class="menu" href="#">Hyperlink 3</a>
<a class="menu" href="#">Hyperlink 4</a>
<a class="menu" href="#">Hyperlink 5</a>
</div>
<p><a style="margin-left:40px;" href="logout.php">Logout</a></p>
</div><div id="content">
<h2>Benutzer bearbeiten</h2>
<form name="create" action="start.php?action=user_edit" method="post">
<table class="cont_table" align="center" cellspacing="0" style="text-align:center;">
<tr>
<th style="text-align:center;">ID</th><th style="text-align:center;">Userlevel</th><th style="text-align:center;">User</th>
<th style="text-align:center;">Timeout</th><th style="text-align:center;">E-Mail</th><th style="text-align:center;">Status</th><th style="text-align:center;">Bearbeiten</th>
<tr valign='top'><td style="text-align:center;">1</td><td style="text-align:center;"><span style='color:#FF0000;'>Administrator</span></td><td style="text-align:center;">admin</td><td style="text-align:center;">Timeout Anthering<br>
TIMEOUT 2<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=admin@test.com&email_user=admin&">admin@test.com</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"></td></tr>
<tr style='background-color:#ece2d1;' valign='top'><td style="text-align:center;">2</td><td style="text-align:center;"><span style='color:#008040;'>Moderator</span></td><td style="text-align:center;">mod1</td><td style="text-align:center;">TIMEOUT 2<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=mod1@test.com&email_user=mod1&">mod1@test.com</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=2&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=2&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr valign='top'><td style="text-align:center;">3</td><td style="text-align:center;"><span style='color:#008040;'>Moderator</span></td><td style="text-align:center;">mod2</td><td style="text-align:center;">TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=mod2&">koglchri@yahoo.de</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=3&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=3&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr style='background-color:#ece2d1;' valign='top'><td style="text-align:center;">4</td><td style="text-align:center;"><span style='color:#FF0000;'>Administrator</span></td><td style="text-align:center;">Kisi</td><td style="text-align:center;">Timeout Anthering<br>
TIMEOUT 2<br>
TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=Kisi&">koglchri@yahoo.de</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=4&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=4&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr valign='top'><td style="text-align:center;">5</td><td style="text-align:center;"><span style='color:#008040;'>Moderator</span></td><td style="text-align:center;">test</td><td style="text-align:center;">Timeout Anthering<br>
TIMEOUT 2<br>
TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=test&">koglchri@yahoo.de</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=5&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=5&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr style='background-color:#ece2d1;' valign='top'><td style="text-align:center;">6</td><td style="text-align:center;"><span style='color:#008040;'>Moderator</span></td><td style="text-align:center;">sdfsf</td><td style="text-align:center;">Timeout Anthering<br>
TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=sdfsf&">koglchri@yahoo.de </a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=6&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=6&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr valign='top'><td style="text-align:center;">7</td><td style="text-align:center;"><span style='color:#008040;'>Moderator</span></td><td style="text-align:center;">yxcv</td><td style="text-align:center;">TIMEOUT 2<br>
TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=yxcv&">koglchri@yahoo.de</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=7&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=7&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr style='background-color:#ece2d1;' valign='top'><td style="text-align:center;">9</td><td style="text-align:center;"><span style='color:#FF0000;'>Administrator</span></td><td style="text-align:center;">kisi1</td><td style="text-align:center;">Timeout Anthering<br>
TIMEOUT 2<br>
TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=kisi1&">koglchri@yahoo.de </a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=9&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=9&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr></tr>
</table>
</form>
</div>
<br style="clear:both;" />
</div>
</body>
</html>
Ich arbeite gerade an einer Seite und möchte diese auch validiert schreiben. Allerdings frage ich mich ob dies überhaupt möglich ist, wenn man mit der $_GET[] methode arbeitet. Es werden immer Fehlermeldungen wegen der Url erzeugt. Dies benötige ich allerdings wegen dem $_GET...
Hier ein Beispiel von meiner erzeugten Seite:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Timeout</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript">
<!--
function popup(adress,winname,w,h)
{
window.open(adress,winname,'toolbar=no,resizable=yes,status=no,menubar=no,width=' + w + ',height='+ h);
}
//-->
</script>
<!--
Example Link
<a href="#" onClick="popup('asfd.php','asdfasdfasdf',400,400)">asdf</a>
//--></head>
<body>
<div id="container">
<div id="title">
<img src="images/timeout_logo.jpg" style="float:right;margin-left:3px;" alt="Logo - Timeout" />
<p>Willkommen <span class='wichtig'>admin</span> im</p>
<h1><span class="first">A</span>dmin <span class="first">C</span>ontrol <span class="first">P</span>anel</h1> </div> <div id="left">
<div class="menucontainer">
<p class="menutitle">Usermanagement</p>
<a class="menu" href="start.php?action=create_user&">Benutzer erstellen</a>
<a class="menu" href="start.php?action=user_edit&">Benutzer bearbeiten</a>
<a class="menu" href="start.php?action=user_edit_profile&">Profil bearbeiten</a>
</div>
<div class="menucontainer">
<p class="menutitle">MENU 2</p>
<a class="menu" href="#">Hyperlink 1</a>
<a class="menu" href="#">Hyperlink 2</a>
<a class="menu" href="#">Hyperlink 3</a>
<a class="menu" href="#">Hyperlink 4</a>
<a class="menu" href="#">Hyperlink 5</a>
</div>
<div class="menucontainer">
<p class="menutitle">MENU 3</p>
<a class="menu" href="#">Hyperlink 1</a>
<a class="menu" href="#">Hyperlink 2</a>
<a class="menu" href="#">Hyperlink 3</a>
<a class="menu" href="#">Hyperlink 4</a>
<a class="menu" href="#">Hyperlink 5</a>
</div>
<p><a style="margin-left:40px;" href="logout.php">Logout</a></p>
</div><div id="content">
<h2>Benutzer bearbeiten</h2>
<form name="create" action="start.php?action=user_edit" method="post">
<table class="cont_table" align="center" cellspacing="0" style="text-align:center;">
<tr>
<th style="text-align:center;">ID</th><th style="text-align:center;">Userlevel</th><th style="text-align:center;">User</th>
<th style="text-align:center;">Timeout</th><th style="text-align:center;">E-Mail</th><th style="text-align:center;">Status</th><th style="text-align:center;">Bearbeiten</th>
<tr valign='top'><td style="text-align:center;">1</td><td style="text-align:center;"><span style='color:#FF0000;'>Administrator</span></td><td style="text-align:center;">admin</td><td style="text-align:center;">Timeout Anthering<br>
TIMEOUT 2<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=admin@test.com&email_user=admin&">admin@test.com</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"></td></tr>
<tr style='background-color:#ece2d1;' valign='top'><td style="text-align:center;">2</td><td style="text-align:center;"><span style='color:#008040;'>Moderator</span></td><td style="text-align:center;">mod1</td><td style="text-align:center;">TIMEOUT 2<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=mod1@test.com&email_user=mod1&">mod1@test.com</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=2&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=2&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr valign='top'><td style="text-align:center;">3</td><td style="text-align:center;"><span style='color:#008040;'>Moderator</span></td><td style="text-align:center;">mod2</td><td style="text-align:center;">TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=mod2&">koglchri@yahoo.de</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=3&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=3&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr style='background-color:#ece2d1;' valign='top'><td style="text-align:center;">4</td><td style="text-align:center;"><span style='color:#FF0000;'>Administrator</span></td><td style="text-align:center;">Kisi</td><td style="text-align:center;">Timeout Anthering<br>
TIMEOUT 2<br>
TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=Kisi&">koglchri@yahoo.de</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=4&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=4&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr valign='top'><td style="text-align:center;">5</td><td style="text-align:center;"><span style='color:#008040;'>Moderator</span></td><td style="text-align:center;">test</td><td style="text-align:center;">Timeout Anthering<br>
TIMEOUT 2<br>
TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=test&">koglchri@yahoo.de</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=5&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=5&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr style='background-color:#ece2d1;' valign='top'><td style="text-align:center;">6</td><td style="text-align:center;"><span style='color:#008040;'>Moderator</span></td><td style="text-align:center;">sdfsf</td><td style="text-align:center;">Timeout Anthering<br>
TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=sdfsf&">koglchri@yahoo.de </a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=6&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=6&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr valign='top'><td style="text-align:center;">7</td><td style="text-align:center;"><span style='color:#008040;'>Moderator</span></td><td style="text-align:center;">yxcv</td><td style="text-align:center;">TIMEOUT 2<br>
TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=yxcv&">koglchri@yahoo.de</a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=7&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=7&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr>
<tr style='background-color:#ece2d1;' valign='top'><td style="text-align:center;">9</td><td style="text-align:center;"><span style='color:#FF0000;'>Administrator</span></td><td style="text-align:center;">kisi1</td><td style="text-align:center;">Timeout Anthering<br>
TIMEOUT 2<br>
TIMEOUT 3<br>
</td><td style="text-align:center;"><a href="start.php?action=mail_contact&addressee=koglchri@yahoo.de&email_user=kisi1&">koglchri@yahoo.de </a></td><td style="text-align:center;"><span style='color:#008040;'>aktiv</span></td>
<td style="text-align:center;"><a href="start.php?action=user_edit_data&ued_id=9&"><img src="images/edit.gif" alt="Edit" border="0"></a>
<a href="start.php?action=user_delete&user_delete_id=9&"><img src="images/delete.gif" alt="Delete" border="0"></a></td></tr></tr>
</table>
</form>
</div>
<br style="clear:both;" />
</div>
</body>
</html>
Kommentar