Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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 April 14th, 2004, 08:36 AM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 2 ; pp 59 - 62

Greetings,
I've copied the code from the Wrox download on pages 59 through 62.

The first part presents a form box prompting the user for a username and password.

The receiving php script (movie1.php) takes the form values into the session.

$_SESSION['username] = $_POST['user'];

If the correct form values are presented - the user is authorized.

The conditional runs like this:

if (($_SESSION['username']=='Joe')AND($_SESSION['userpass']=='12345'))
 {
   $_SESSION['authuser']=1;
 }
else
 {
   echo "Sorry, etc...";
 }

If the name username and password are not correct - the user gets: "Sorry you don't have permission, etc."

I have run this script line for line and get the latter of the two:
"Sorry you don't have permission, etc."

using the hardcoded values of:
Joe
and
12345

Could somebody on the NG please help.
Thank you.
TR

 
Old April 15th, 2004, 04:37 AM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the first 8 lines in the moviesite.php must be deleted.
thatll work.
you dont need the $_SESSION['authuser']=1...

 
Old April 15th, 2004, 04:44 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Quote:
quote:Originally posted by marcelo
 the first 8 lines in the moviesite.php must be deleted.
thatll work.
you dont need the $_SESSION['authuser']=1...
Would you enlighten us as to why this is the solution to the problem?

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old April 27th, 2004, 11:21 PM
Authorized User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by marcelo
 the first 8 lines in the moviesite.php must be deleted.
thatll work.
you dont need the $_SESSION['authuser']=1...

I have the same problem too! You have to use $_SESSIOIN because that is what the lesson is teaching you to learn how to use passing the visitor;s username and if you have permission to view the next page.

Can we get some help here?

thanks

 
Old April 28th, 2004, 01:30 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Future forum goers please post your questions about this example to this thread:
http://p2p.wrox.com/topic.asp?TOPIC_ID=12913

Which has solutions to the problem and relevant snips of the code.

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::




Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 11, Favorites Viewer pp 347-365 corncrake BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 June 24th, 2008 05:13 AM
Base 62 counter (sort of) jbako C# 0 April 12th, 2007 08:59 PM
Cap2, page 59-62 mollick2 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 January 15th, 2007 06:55 PM
Chapter 4, pp 130-131 luciano991 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 August 15th, 2006 11:23 AM
Chapter 4 pp. 118-119 luciano991 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 August 13th, 2006 01:56 PM





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