Hi,
I have been attempting to set up a very basic protected
page. This would be based on a cookie. I know that it is
easily cracked however I don't care if it's cracked.
I am using PHP 3 (since my web host hasn't upgraded yet to
PHP 4). Basically, I have checked for a cookie, than
cross-checked it with my database. If it's good, they
will see a page, if not, they don't.
In MSIE 5.0 the page works fine. I have tested it with a
cookie, deleting the cookie and creating my own cookie.
MSIE handles each response appropriately.
Netscape loads the appropriate page, however it doesn't
render. The page continues to say that it's loading.
When I stop the browser to view the source, my page is
there but it doesn't show on my screen.
Since I am a newbie to PHP, I was curious if it was a
problem with my code or if it was a problem with Netscape
that every other programmer knows about. I have included
the code just in case. The actual HTML pages has been
omitted as with critical information about my database.
Thanks for your time.
Richard Fujimoto
Fuji Creations, Inc.
http://wwww.fujicreations.com
[code]
<?php
function showheader ($title){
?>
<head><title><?php echo $title ?>
</title><link rel="stylesheet" href="styles.css"></head>
<?php
}
function showfooter() {
?>
</body><?php}if ($user_name AND $id_hash) {
$db = mysql_connect("localhost", "?????"); mysql_select_db("??????", $db);
$query = mysql_query("SELECT * FROM ???? WHERE (user_name='$user_name')");
$info = mysql_fetch_array($query);
if (mysql_num_rows($query) < 1 ) {
showheader("You are unauthorized to view this page"); ?>
<body bgcolor="#FFFFFF"><table cellpadding=5 cellspacing=3
border=0 width=400><tr><td><font face=arial size=4>Sorry,
You Dont Have The Key</td></tr></table>
<?php showfooter();
exit;
}
elseif (mysql_num_rows($query) == 1) {
showheader("You are authorized"); ?>
<body bgcolor="#FFFFFF"><DIV ID="overDiv"
STYLE="position:absolute; visibility:hide;"></DIV>
<SCRIPT TYPE="" LANGUAGE="JavaScript"><!--
var width = "250";
var border = "3";
var offsetx = 2;
var offsety = 2;
var fcolor = "#CCCCFF";
var backcolor = "#000099";
var textcolor = "#000000";
var capcolor = "#FFFFFF";
var closecolor = "#99FF99";// -->
</SCRIPT>
<script src="overlib.js" type="text/javascript"
language="Javascript"></script>
<table><tr><td> This will be some text. And the actual
HTML Page.</td></tr></table>
<?php showfooter();
exit; }
}
else { showheader("You Have Not Registered") ?>
<table><tr><td> Text, Blah, blah</td></tr></table>
}
?>
[/code]