Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 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 April 17th, 2005, 08:17 AM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to StuartD
Default Passing the visitors username

Hi there,
I'm having trouble getting the example on page 52-53 to work, and was wondering if anyone could maybe help.

I've created the files movie1.php and moviesite.php, and the variable passes, because i can see it in the second URL (in the browser).
However moviesite does not output any results! :(

In fact it doesn't seem to be outputing any html at all.
could this be something in my php.ini file thats not configured correctly? I've pored over the code to make sure its as printed in the book, even rewrote the two files with the same result.

Any help would be really appreciated.
StuartD
 
Old April 20th, 2005, 03:47 AM
Registered User
 
Join Date: Apr 2005
Location: Madrid, Madrid, Spain.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I´m reading chapter two of the Spanish edition, so I can't match your pages 52 and 53 with my book and I don´t know exactly which example you are refering to.

I´m using xampp and I had problems with my Apache config and I couldn´t browse pages that were written with both html and php.

I had to add '.html' extension to the line 'AddType application/x-httpd-php .php .php4 .php3 .phtml' inside httpd.conf and the examples are working fine now, html and php just married ;).

Hope this helps you,
Ignacio
Madrid - Spain

 
Old May 15th, 2005, 09:07 PM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to teapeng
Default

one important thing that not mentioned in this book while using notepad is, make sure all the php file is save as "file.php". The double quote sign is important to avoid notepad adding a .txt behind, else the php file wont works in anyway.

 
Old September 27th, 2005, 04:32 PM
Registered User
 
Join Date: Sep 2005
Location: Zion, IL, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm getting the same thing, but on pages 47 & 48. My session path is set to c:\php\tmp and the file is getting generated with the username and authuser information. Is there something in the php.ini that may need to be set?

My MOVIE1.PHP file:

<?php
session_start();
$_SESSION['username'] = "Joe12345";
$_SESSION['authuser'] = 1;
?>
<html>
<head>
<title>Find my Favorite Movie!</title>
</head>
<body>
<?php
  $myfavmovie = urlencode("Life of Brian");
  echo "<a href='moviesite.php?favmovie=$myfavmovie'>";
  echo "Click here to see information about my favorite movie!";
  echo "</a>";
?>
</body>
</html>

My MOVIESITE.PHP file:
<?php
session_start();

if ($_SESSION['authuser'] != 1) {
  echo "Sorry, but you don't have permission to view this page, you loser!";
  exit();
}
?>

<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 movie rating for this movie is: ";
  echo $movierate;
?>
</body>
</html>

 
Old September 27th, 2005, 04:59 PM
Registered User
 
Join Date: Sep 2005
Location: Zion, IL, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Fixed it, not sure what it was exactly. In order to check my code I dl'd a PHP editor to double check syntax and after re-entering all the code it works.

The only difference I can see is:
$_SESSION['username'] = 'Joe12345'

uses single quotes in the editor, the book has you use double quotes.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Tracking Visitors hugh@kmcnetwork.com ASP.NET 1.0 and 1.1 Professional 0 May 28th, 2006 05:12 PM
passing visitors user name CJackson BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 October 11th, 2004 08:56 AM
Username Changes Ben Horne Forum and Wrox.com Feedback 2 March 12th, 2004 12:20 PM





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