Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP 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 January 23rd, 2005, 10:31 PM
Authorized User
 
Join Date: Jan 2005
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No problem.
$_GET is a global array defined by default. However, when you request a $_GET['image'], the array $_GET will need to have an index with a key image and some value defined. Otherwise, it will output an error. This is only if $_GET['image'] is on the right side of an equal sign, like:

$something= $_GET['image']
This is saying that you want to define a new varaiable named something with a value that is equal to the value of $_GET['image']. Of course, the value of $_GET['image'] needs to exist before you can pass that value to another variable. This is why, it that value is not there, it will generate an error.

So how to you pass/define a $_GET key/value?
Normally, when that page opens up, it should be defined in the url. so on a previous page, something like this link would define the value of a $_GET array key.

<a href="http://www.google.com?image=wolferd&page=user">Some Link to google</a>

so when you click on that link and google.com opens up, that page could use the following values:

$image = $_GET['wolferd'];
$user = $_GET['page'];

Hope it helps.









Similar Threads
Thread Thread Starter Forum Replies Last Post
UTF-8 in XML: "Undeclared Entity" errors? richcon XSLT 3 April 30th, 2006 03:19 AM
changing the value of variables in PHP jflores1 PHP How-To 1 January 8th, 2006 12:09 AM
php $_GET samon_18 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 December 24th, 2005 07:39 PM
Passing Variables from PHP to PHP brian3166 PHP How-To 4 January 31st, 2005 12:44 AM
Getting Error 'EXEC' : undeclared identifier JAPPY Visual C++ 0 April 7th, 2004 09:35 AM





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