Wrox Programmer Forums
|
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 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 December 24th, 2005, 04:22 PM
Registered User
 
Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default php $_GET

i'm new to php, so i downloaded some code, which is below and it just wouln't work for me, it just returns a blank screen

name.html

<html>
<head>
  <title></title>
</head>
<body>

<form action="name.php" method="get">
<p><input type="text" name="name" size=32 value="Enter your Name."></p>
<p><input type="submit" name="submit"></p>
</form>

</body>
</html>


name.php

<html>
<?php

/*In this program you'll learn how to get vars from
an html web page.*/

# Setting up Variables
$name = $HTTP_GET_VARS['name'];

# Setup to echo statement
echo "Your name is: $name.";

?>
</html>

i've looked at different websites and no matter what i change i wouln't work for me:(
 
Old December 24th, 2005, 07:39 PM
Authorized User
 
Join Date: Oct 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
Try altering name.php to this

name.php:

<html>
<?php

/*In this program you'll learn how to get vars from
an html web page.*/

# Setting up Variables
$name = $_GET['name'];

# Setup to echo statement
echo "Your name is: $name.";

?>
</html>

Reason:
HTTP_GET_VARS and HTTP_POST_VARS is not now supported in PHP5, (assuming you are using php5), but there are a lot more reasons for using $_GET and $_POST see this post from a while back

http://p2p.wrox.com/topic.asp?TOPIC_ID=9945

hope this helps

David





Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference b/w $_GET & $_HTTP_GET_VARS ashuphp Beginning PHP 1 April 14th, 2007 08:50 AM
Problems with $_GET and $_POST everetts Beginning PHP 1 March 18th, 2007 03:44 AM
$_GET sudheshna Beginning PHP 1 February 18th, 2006 05:22 AM
php _get and undeclared variables wolferd1 Beginning PHP 10 January 23rd, 2005 10:31 PM
How to use $_GET with arrays? pseudo class Beginning PHP 6 November 20th, 2004 02:06 PM





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