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 May 31st, 2005, 03:12 AM
Registered User
 
Join Date: May 2005
Location: , Oregon, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default new need help displaying echo $SESSION['authuser']

im attemping to follow all of the examples in this book. my newest problem is in Chap.2 the section on passing through forms. the login page is working, the link, "<a href=’http://localhost/moviesite.php?favmovie=$myfavmovie’>”, is sending me to moviesite.php, but this page isn't showing the username on the first line

Welcome to our site, !

is all it will display and ofcourse it should be

Welcome to our site, Joe!

just wondering if anyone knows what might cause this (sorry i havent included the original code that i typed up its on my home computor and im at work)

thanks
 
Old May 31st, 2005, 02:06 PM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When you get home, can you post the code you have..

Also, check carefully your variable names as they are case sensitve...

Edit: can you also post back which page this is from?
 
Old May 31st, 2005, 08:23 PM
Registered User
 
Join Date: May 2005
Location: , Oregon, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

this is moviesite.php and will be found on page 60-61 (i am using an older version of this book.)

<?php
session_start();
//check to see if user has loged on with valid password
    if ($_SESSION['authuser']==1) {
    die('Sorry, but you dont have permission to view this page!');
    }
?>
<html>
<head>
<title>My Movie Site - <?php echo $_REQUEST['favmovie'] ?></title>
</head>
<body>
<?php
    echo "Welcome to our site, ";
    echo $_SESSION['username'];
    echo "!<br>";
    echo "My favorite movie is ";
    echo $_REQUEST['favmovie'];
    echo "<br>";
    $movierate=5;
    echo "My rating for the movie is: ";
    echo $movierate;
?>
</body>
</html>

thanks again

 
Old June 1st, 2005, 04:41 AM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok...

Alter this code:

<?php
session_start();
//check to see if user has loged on with valid password


to look like this, and post back with the extra output

<?php
session_start();
while(list($vt, $val) = each($_SESSION))
{
echo "$vt == > $val<br>";
}
echo "<br>";
//check to see if user has loged on with valid password

What this does is output the contents and keys of the $_SESSION superglobal so we can see what values are being passed to the script.
 
Old June 1st, 2005, 04:45 AM
Registered User
 
Join Date: May 2005
Location: , Oregon, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i will do that and get back to you

 
Old June 1st, 2005, 10:02 AM
Registered User
 
Join Date: May 2005
Location: , Oregon, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

all it seemed to do was add a blank line or two before the main text

 
Old June 1st, 2005, 03:03 PM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That would indicate that session info is not being passed at all.

Do you have any kind of cookie controls set on your browser? or any software that may be blocking them?

 
Old June 1st, 2005, 05:49 PM
Registered User
 
Join Date: May 2005
Location: , Oregon, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

that a good question in the privacy tab under internet options i have it set to medium. im using the windows firewall (windows xp), what other software would block cookies?

 
Old June 3rd, 2005, 12:34 PM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Zone alarmns pro does and I know that Norton Internet Suite has cookie control ...

One thing to try, try adding localhost and 127.0.0.1 to the sites list - set them to allow...

And then try running the script from http://127.0.0.1/moviesite.php?favmovie=$myfavmovie

 
Old June 8th, 2005, 10:40 PM
Registered User
 
Join Date: May 2005
Location: , Oregon, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dbdave i really wanted to thank you for you help i got it to work





Similar Threads
Thread Thread Starter Forum Replies Last Post
search data echo urbanaccess Access 7 January 23rd, 2007 10:54 AM
I need a echo wizard Anne1 PHP How-To 1 December 16th, 2006 04:20 AM
echo "\n" problem jun99 PHP How-To 4 November 29th, 2005 01:01 PM
echo "\n" problem jun99 Beginning PHP 0 November 27th, 2005 05:12 PM
Ch 2 Page 53: Undefined index: authuser Airidh BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 25 February 22nd, 2005 07:34 PM





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