 |
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
|
|
|
|

May 31st, 2005, 03:12 AM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

May 31st, 2005, 02:06 PM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|

May 31st, 2005, 08:23 PM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 1st, 2005, 04:41 AM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

June 1st, 2005, 04:45 AM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i will do that and get back to you
|
|

June 1st, 2005, 10:02 AM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
all it seemed to do was add a blank line or two before the main text
|
|

June 1st, 2005, 03:03 PM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|

June 1st, 2005, 05:49 PM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|

June 3rd, 2005, 12:34 PM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 8th, 2005, 10:40 PM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
dbdave i really wanted to thank you for you help i got it to work
|
|
 |