Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
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

Reply With Quote
  #3 (permalink)  
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.

Reply With Quote
  #4 (permalink)  
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>

Reply With Quote
  #5 (permalink)  
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.



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:12 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.