Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 14th, 2004, 09: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

Reply With Quote
  #2 (permalink)  
Old April 15th, 2004, 05: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...

Reply With Quote
  #3 (permalink)  
Old April 15th, 2004, 05: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 5 Times in 5 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
::::::::::::::::::::::::::::::::::::::::::
Reply With Quote
  #4 (permalink)  
Old April 28th, 2004, 12:21 AM
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

Reply With Quote
  #5 (permalink)  
Old April 28th, 2004, 02: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 5 Times in 5 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
::::::::::::::::::::::::::::::::::::::::::
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 06:13 AM
Base 62 counter (sort of) jbako C# 0 April 12th, 2007 09: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 12:23 PM
Chapter 4 pp. 118-119 luciano991 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 August 13th, 2006 02:56 PM



All times are GMT -4. The time now is 09:53 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.