HI!
I'm trying to may a place where users with the right username and password can log in and view some flash or jpg using php.
Here is the code I have so far that came from the php and mysql book by Wellington & Thomson below. I added the image source part on line 33 you can see it not quite in action (or the error) at http://www.goodtogonetworks.com/2login.php and find that the image wont work. Any ideas to make this simple code work as intended? Thanks in advance!
<?
if(!isset($name)&&!isset($password))
{
//Visitor needs to enter a name and password
?>
<center>
<h1>Please Log In</h1>
<img src="cheapestees-store_1743_2080162.gif" height=200 width=200>"
<form method = post action = "secret.php">
<table border = 1>
<tr>
<th> Username </th>
<td> <input type = text name = name> </td>
</tr>
<tr>
<th> Password </th>
<td> <input type = password name = password> </td>
</tr>
<tr>
<td colspan =2 align = center>
<input type = submit value = "Log In">
</td>
</tr>
</form>
</center>
<?
}
else if($name=="user"&&$password=="pass")
{
// visitor's name and password combination are correct
echo "<h1>Here it is!</h1>";
echo "I bet you are glad you can see this secret page.";
echo ""<img src="cheapestees-store_1743_2080162.gif" height=200 width=200>""
}
else
{
// visitor's name and password combination are not correct
echo "<h1>Go Away!</h1>";
echo "You are not authorized to view these works of art.";
}
?>