Wrox Programmer Forums
|
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 15th, 2007, 06:36 PM
Registered User
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cap2, page 59-62

i keep having a problem, ive used the right usename and password but it still says "Sorry,you dont have permission to view this page, you loser"

I've checked a few times but i can't find anything different from than in the book...

movie1.php
Code:
<?php
    session_start();
    $_SESSION['username']=$_POST['user'];
    $_SESSION['username']=$_POST['pass'];
    $_SESSION['authuser']=0;

//Check username and password information

    if (($_SESSION['username']== 'Joe') AND
            ($_SESSION['userpass']== '12345'))
    {
    $_SESSION['authuser']=1;
    }
    else
    {
        echo "Sorry, but you don't have permission to view this page, you loser!";
    exit();
    }
?>
<html>
<head>
<title>Find my Favorite Movie!</title>
</head>
<body>
<?php
    $myfavmovie=urlencode("Life of Brian");
    echo "<a href='http://localhost/moviesite.php?favmovie=$myfavmovie'>";
    echo "Click here to see information about my favorite movie!";
    echo "</a>";
?>
</body>
</html>
login.php
Code:
<?php
session_unset();

?>
<html>
<head>
<title>Please Log In</title>
</head>

<body>
<form method="post" action="http://localhost/movie1.php">
    <p>Enter your username:
        <input type="text" name="user">
    </p>
    <p>Enter your password:
        <input type="password" name="pass">
    </p>
    <p>
        <input type="submit" name="Submit" value="Submit">
    </p>
</form>
</body>
</html>
 
Old January 15th, 2007, 06:55 PM
Registered User
 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i found the problem, typo on line 4 of movie1.php






Similar Threads
Thread Thread Starter Forum Replies Last Post
Base 62 counter (sort of) jbako C# 0 April 12th, 2007 08:59 PM
how to register servlets with Tomcat 5.59 server urstruly90 Apache Tomcat 0 July 21st, 2005 03:50 AM
Run-time Error 59 Aine Catherine Beginning VB 6 0 March 10th, 2005 09:22 AM
Auto submit after 59 seconds steeve_1001 HTML Code Clinic 2 March 8th, 2005 01:08 PM
chapter 2 ; pp 59 - 62 ritter BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 4 April 28th, 2004 01:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.