 |
BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143
 | This is the forum to discuss the Wrox book Beginning PHP 6, Apache, MySQL 6 Web Development by Timothy Boronczyk, Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz; ISBN: 9780470391143 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 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 21st, 2010, 07:51 AM
|
|
Registered User
|
|
Join Date: May 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
chapter 2 ,passing the visitor user name
hello
why the code movie1.php -- moviesite.php in chapter 2 page 38-39
cannot display the result correctly ?
(in my case I have changed the name to passvisitorname.php and visitorname.php)
It display "sorry ,but you don't have permission to view this page !"
I have checked and rechecked the code,all the same with the book.
movie1.php seem to be ok,but moviesite.php ack as if S_SESSION['authuser']!=1;
any help needed thank you
I used :apache 2.2 and php 5.2.13
regard
hanf
I attach the code below
//---------------------------visitorname.php
<?php
session_start();
//check to see if user has log in with a valid password
if($_SESSION['authuser'] !=1)
{
echo "sorry ,but you don't have permision to view this page";
exit();
}
?>
<html>
<head>
<title>my movie site
<?php
echo $_GET['favmovie'];
?>
</title>
</head>
<body>
<?php
echo 'welcome to our site ';
echo $_SESSION['username'] ;
echo '! <br/>';
echo 'my favorite movie is ';
echo $_GET['favmovie'];
echo '<br/>';
$movierate=5;
echo 'my movie rating for this movie is ';
echo $movierate;
?>
</body>
</html>
//---------------------------passvisitorname.php
<?php
session_start();
$_SESSION['username']='Joe12345';
$_SESSION['authuser']=1;
?>
<html>
<head>
<title>
find my favourite movie
</title>
</head>
<body>
<?php
$myfavmovie=urlencode('life of brian ');
echo "<a href=\"visitorname.php?favmovie=$myfavmovie\">";
echo 'click here to find my favourite movie';
echo '</a>';
?>
</body>
</html>
Last edited by hanf; May 21st, 2010 at 10:43 AM..
|
|

May 21st, 2010, 08:18 PM
|
|
Registered User
|
|
Join Date: May 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
chapter 2 ,passing the visitor user name
hello
it work if I change the php starting tag from
<?php to <? php
any body know why ?
please teach me
tq
hanf
|
|

May 23rd, 2010, 02:45 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
|
|
Quote:
Originally Posted by hanf
hello
it work if I change the php starting tag from
<?php to <? php
hanf
|
:S Weird. The only suggestion I have is to check the PHP docs at http://www.php.net Some of the syntax of languages can produce some strange effects, and especially since PHP6 is still only available in Beta right now, you may be experiencing a bug that still needs to be ironed out. Or maybe this is a syntax issue; I've avoided working with 6 yet for just these kinds of reasons. It looks like it updates PHP to include a number of things that the other packages like Java and .NET have so it's a major release... it will just be nice when they stop promoting it and actually ship it out.
__________________
-------------------------
Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe
When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper
Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
|
|
 |