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