problemer med lidt hjemmeside progr. -mysql + lidt cookies...
jeps så skulle der progges hjemmeside.... troede jeg :0) men l**** vil ikke helt som jeg vil...her kommer først hele min side :
<?php include (\'chkc.php\'); ?>
<html>
<head>
<title>Den store vilde 3t hp.</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<script language=\"JavaScript\">
<!--
function MM_reloadPage(init) {
if (init==true) with (navigator) {if ((appName==\"Netscape\")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
</head>
<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"418AB4\">
<div id=\"Layer1\" style=\"position:absolute; left:828px; top:99px; width:104px; height:464px; z-index:1\">
<table width=\"99\" border=\"0\" height=\"117\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"13%\" height=\"8\"><img src=\"/topleftlogin.gif\" width=\"19\" height=\"19\" border=\"0\"></td>
<td width=\"68%\" height=\"8\" bgcolor=\"418AB4\"> </td>
<td width=\"19%\" height=\"8\"><img src=\"/toprightlogin.gif\" width=\"19\" height=\"19\" border=\"0\" vspace=\"0\" hspace=\"0\"></td>
</tr>
<tr>
<td width=\"13%\" height=\"93\" bgcolor=\"418AB4\"> </td>
<td width=\"68%\" height=\"93\" bgcolor=\"418AB4\">
<?php include (\"logmenu.php\") ?>
</td>
<td width=\"19%\" height=\"93\" bgcolor=\"418AB4\"> </td>
</tr>
<tr>
<td width=\"13%\" height=\"18\"><img src=\"/btmleftlogin.gif\" width=\"19\" height=\"19\"></td>
<td width=\"68%\" height=\"18\" bgcolor=\"418AB4\"> </td>
<td width=\"19%\" height=\"18\"><img src=\"/btmrightlogin.gif\" width=\"19\" height=\"19\"></td>
</tr>
</table>
<p> Du skal være logget ind for at kunne se resten af siden......<br>
</p>
<hr>
<p>-Er du endnu ikke bruger så kontakt <a href=\"mailto:admin@litteratur.f2s.com\">mig</a>
og du vil blive oprettet hurtigst muligt.</p>
</div>
<div id=\"Layer2\" style=\"position:absolute; left:8px; top:93px; width:91px; height:473px; z-index:2\">
<table width=\"92\" border=\"0\" cellspacing=\"0\" height=\"473\" cellpadding=\"0\">
<tr>
<td width=\"19\" height=\"18\"><img src=\"/topleftlogin.gif\" width=\"19\" height=\"19\" border=\"0\"></td>
<td width=\"56\" height=\"18\" bgcolor=\"418AB4\"> </td>
<td width=\"18\" height=\"18\"><img src=\"/toprightlogin.gif\" width=\"19\" height=\"19\" border=\"0\"></td>
</tr>
<tr>
<td width=\"19\" height=\"434\" bgcolor=\"418AB4\"> </td>
<td width=\"56\" height=\"434\" bgcolor=\"418AB4\">
<p>Forside<br>
Statistik<br>
Brugere<br>
Adresser<br>
Tlf.<br>
Events</p>
<p> </p>
</td>
<td width=\"18\" height=\"434\" bgcolor=\"418AB4\"> </td>
</tr>
<tr>
<td width=\"19\"><img src=\"/btmleftlogin.gif\" width=\"19\" height=\"19\" border=\"0\"></td>
<td width=\"56\" bgcolor=\"418AB4\"> </td>
<td width=\"18\"><img src=\"/btmrightlogin.gif\" width=\"19\" height=\"19\" border=\"0\"></td>
</tr>
</table>
</div>
<div id=\"Layer3\" style=\"position:absolute; left:8px; top:571px; width:921px; height:23px; z-index:3\">
<div align=\"center\">
<table width=\"917\" border=\"0\" cellspacing=\"0\" height=\"24\">
<tr>
<td width=\"205\"> </td>
<td width=\"461\">
<div align=\"center\">Copyright © 2001 Stephan Marc Hansen®™</div>
</td>
<td width=\"245\"> </td>
</tr>
</table>
</div>
</div>
<div id=\"Layer5\" style=\"position:absolute; left:106px; top:100px; width:709px; height:43px; z-index:5\">
<div align=\"center\"><font size=\"6\">Forsiden</font></div>
</div>
<table width=\"930\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td height=\"60\" valign=\"top\" colspan=\"3\">
<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"928\" height=\"62\">
<table width=\"928\" border=\"0\" cellspacing=\"0\" height=\"51\">
<tr>
<td width=\"91\"><img src=\"/lillelogo.jpg\" width=\"91\" height=\"51\"></td>
<td width=\"833\"><img src=\"/storlogo.jpg\" width=\"833\" height=\"51\"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width=\"2\"></td>
</tr>
<tr>
<td width=\"92\" height=\"476\" valign=\"top\">
<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"101\" height=\"476\"></td>
</tr>
</table>
</td>
<td width=\"722\" valign=\"top\">
<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"722\" height=\"57\" valign=\"top\">
<div align=\"center\"><br>
<font size=\"+1\"><b></b></font></div>
</td>
</tr>
<tr>
<td height=\"419\">
<table width=\"721\" border=\"0\" cellspacing=\"0\" height=\"417\">
<tr>
<td width=\"8\" height=\"22\"> </td>
<td width=\"696\" height=\"10\"> </td>
<td width=\"11\" height=\"22\"> </td>
</tr>
<tr>
<td width=\"8\" height=\"388\"> </td>
<td width=\"696\" height=\"388\">
<table width=\"696\" border=\"0\" cellspacing=\"0\" height=\"385\" cellpadding=\"0\">
<tr>
<td width=\"19\"><img src=\"/topleftlogin.gif\" width=\"19\" height=\"19\"></td>
<td width=\"650\" bgcolor=\"#418AB4\"> </td>
<td width=\"21\"><img src=\"/toprightlogin.gif\" width=\"19\" height=\"19\"></td>
</tr>
<tr>
<td width=\"19\" height=\"349\" bgcolor=\"#418AB4\"> </td>
<td width=\"650\" height=\"349\" bgcolor=\"#6666CC\" bordercolor=\"#663399\">
<div id=\"Layer4\" style=\"position:absolute; width:655px; height:346px; z-index:6; left: 130px; top: 192px; overflow: auto\">
<div align=\"center\">
<p><br>
<br>
Velkommen til hjemmesiden for det tidligere 3.t<br>
Her vil du kunne finde information om klassen<br>
adresser telefonnumre emailadresser osv. samt <br>
samt invitere til fester osv. (ja det var en opfordring)<br>
</p>
<p>Af sikkerhedsgrunde er du nødt til at logge
ind for<br>
at kunne få adgang til andre sider end denne.</p>
<p> </p>
<p> </p>
<p>Mvh. Stephan.</p>
</div>
</div>
</td>
<td width=\"21\" height=\"349\" bgcolor=\"#418AB4\"> </td>
</tr>
<tr>
<td width=\"19\"><img src=\"/btmleftlogin.gif\" width=\"19\" height=\"19\"></td>
<td width=\"650\" bgcolor=\"#418AB4\"> </td>
<td width=\"21\"><img src=\"/btmrightlogin.gif\" width=\"19\" height=\"19\"></td>
</tr>
</table>
</td>
<td width=\"11\" height=\"388\"> </td>
</tr>
<tr>
<td width=\"8\"> </td>
<td width=\"696\"> </td>
<td width=\"11\"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width=\"114\"></td>
<td></td>
</tr>
<tr>
<td height=\"26\" colspan=\"3\" valign=\"top\">
<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td width=\"928\" height=\"26\"></td>
</tr>
</table>
</td>
<td></td>
</tr>
</table>
</body>
</html>
og her kommer så de famøse php scripts ->
chkc.php checker om der er en cookie og skriver \"jes\" i en variabel hvis der er(jeg ved ikke om den virker da mit andet script til at slette cookien igen ikke virker:
<?php
$value = \"3t\";
$lg_in = \"nej\";
if ($HTTP_COOKIE_VARS[\"3tcookie\"] == $value)
$lg_in = \"jep\";
?>
delc.php - her skulle cookien gerne slettes... det bliver den bare ikke da jeg stadigt er \"logget ind\"
<?php
$value = \"SLETTET\";
setcookie (\"3tcookie\", \"$value\", time() - 14400);
?>
logmenu.php
her sker der så det at der tjekkes om chkc har givet positiv resultat - hvis ikke vises en form : loginmnu.php.
<?php
if ($lg_in = \"jep\"){
include (\'rmnu.php\');
} else{
if(!empty($HTTP_POST_VARS[username]) AND !empty($HTTP_POST_VARS[password]))
{
$connection = mysql_connect(\"localhost\",\"mysql3t\",\"mitmegethemmeligepassword\");
mysql_select_db(\"users\", $connection);
$$result = mysql_query(\"select username from users WHERE name=\'$HTTP_POST_VARS[username]\' AND
password=\'$HTTP_POST_VARS[password]\'\");
$number = mysql_num_rows($result);
if($number >= 1)
{
//bruger_ok
include (\'rmnu.php\');
include (\'setc.php\') ;
} else {
// ikke ok.
include (\'loginmnu.php\');
}
}
}
?>
loginmnu.php - her er den form som skal bruges til at logge ind hvis man ikke allerede er det :
<form name=\"Login\" method=\"post\" action=\"\">
Navn:<input type=\"text\" name=\"username\" size=\"10\" maxlength=\"10\">
PW:<input type=\"text\" name=\"password\" size=\"10\" maxlength=\"10\" >
<br>
<input type=\"image\" src=\"/okbtn.gif\" border=\"0\" alt=\"Send\">
</form>
setc.php - sætter en cookie (virker åbenbart alt for godt....
<?php
$value = \"3t\";
setcookie (\"3tcookie\", \"$value\", time() + 14400);
?>
-og ingen kommentarer om at det er slamkodning for det ved jeg i forvejen.....
