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

August 7th, 2005, 07:25 PM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
moviesite login problem chapter 2
hi there,
I've got the same problem as the other guy: I can't login to the moviesite.php via login.php as per p61.
I followed the other thread, and inserted the code:
while(list($key, $val) = each ($_POST))
{
echo "$key -- > $val<br>";
}
in order to output the contents of POST
and i get:
user -- > Joe
pass -- > 12345
Submit -- > Submit
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/movie1.php:4) in /var/www/movie1.php on line 6
Sorry, but you don't have permission!
this is with the code inserted right fter the opening <?php tag, before the session_start()
can anyone help me out here? what does that output mean? My files are below.
Thanks in advance for any replies.
Stu
<?php
while(list($key, $val) = each ($_POST))
{
echo "$key -- > $val<br>";
}
session_start();
$_SESSION['username']=$POST['user'];
$_SESSION['userpass']=$POST['pass'];
$_SESSION['authuser']=0;
//check username and password info
if (($_SESSION['username']== 'Joe') AND
($_SESSION['userpass']== '12345'))
{
$_SESSION['authuser']=1;
}
else
{
echo "Sorry, but you don't have permission!";
exit();
}
?>
<html>
<head>
<title>Find my Favourite 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 favourite movie!";
echo "</a>";
?>
</body>
</html>
----------------------------
<?php
session_start();
//check to see if user has logged in with a valid password
if ($_SESSION['authuser']!=1) {
echo "Sorry, no permissionz!";
exit();
}
?>
<html>
<head>
<title>My Movie Site - <?php echo $_REQUEST['favmovie'] ?></title>
</head>
<body>
<?php
echo "Welcome to my site, ";
echo $_SESSION['username'];
echo "! <br>";
echo "My favourite movie is ";
echo $_REQUEST['favmovie'];
echo "<br>";
$movierate=5;
echo "My rating for this movie is: ";
echo $movierate;
?>
</body>
</html>
---------------------------------
<?php
session_unset();
?>
<html>
<head>
<title>Please Log In</title>
</head>
<body>
<form method="post" action="http://localhost/movie1.php">
<p>Enter you 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>
|
|

August 11th, 2005, 05:45 PM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ok, it seems that the form data is correctly being passed to the page. Remove the extra code and try it again.
Post back with any output received.
|
|

August 12th, 2005, 06:47 PM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi there,
Ok did that, Im back to:
'Sorry, but you don't have permission!'
|
|

August 15th, 2005, 06:04 AM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ughhhh....
I have pored over this code again and again...I am either certain its the same as the code in the book, or am hallucinating.
Can anyone see anything wrong with this? Or any deviations from the code on p59-60?
many thanks
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Ch3 Moviesite table already exists? |
aiche_ag |
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 |
0 |
August 7th, 2007 01:29 PM |
| Chapter 10 login problem |
Dennis Mollet |
BOOK: Beginning VB.NET Databases |
1 |
August 18th, 2005 04:07 AM |
| Chapter 4 PDF Export SQL login problem |
gry52 |
BOOK: Professional Crystal Reports for VS.NET |
4 |
January 18th, 2005 12:02 PM |
| moviesite.php - error line 43 |
Chudz |
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 |
3 |
August 2nd, 2004 03:52 AM |
| Chapter 2, pages 68/69 moviesite.php |
ruairiglenn04 |
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 |
1 |
August 1st, 2004 05:27 AM |
|
 |