Wrox Programmer Forums
|
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
 
Old February 5th, 2006, 07:29 PM
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP register globals question

Thanks in advance to anyone who can help.

I'm currently only on chapter 2, the section on 'using URL variables', and it is not working exactly how it states that it should.

This first bit of code is how it starts off. The author uses it as an example of what happens if you don't use the register global, which is that the data will show up blank. (I've eliminated some of the code from the book as it is not needed)

<html>
<head><Title>My Movie Site - <?php echo $favmovie ?></Title>
</head>
<body>
<?php
    echo "My favorite movie is ";
    echo $favmovie;
?>
</body>
</html>

The author then describes the correct method shown below. Text in bold is what was changed.

<html>
<head><Title>My Movie Site - <?php echo $_request['favmovie'] ?></Title>
</head>
<body>
<?php
    echo "My favorite movie is ";
    echo $_request['favmovie'];
?>b
</body>
</html>

My problem is that the first method which is not supposed to work actually worked but the second 'correct' method didn't.

Could this be down to the way php has been set up? I'm using my webspace provided to be by my ISP and have yet to locate any text on how they have set up php.

Any responce would be greatfully recieved.

Cheers.

 
Old February 6th, 2006, 06:02 PM
Registered User
 
Join Date: Apr 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Found out what the problem was, I hadn't realised that the 'register_globals' are supposed to be in upper case.

Cheers anyway.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Register Globals File Upload Problem fshequin Beginning PHP 0 April 24th, 2005 11:56 PM
register globals problem nulogix Beginning PHP 4 June 16th, 2004 08:49 AM
Error with variable..maybe register globals codefinder Beginning PHP 1 November 19th, 2003 03:31 PM
Register Globals Off cmiller Beginning PHP 4 August 18th, 2003 05:21 PM
Code depending on Register Globals char Beginning PHP 2 July 31st, 2003 11:45 AM





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