By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,334 Members | 2,776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,334 IT Pros & Developers. It's quick & easy.

Outputting $_GET variables

P: 2
I'm having a complete block on something simple:

User makes query i.e.
script.php?query=one

I want to use $query to the print "one"

Cant remember how to do that
Jun 3 '07 #1
Share this Question
Share on Google+
3 Replies


pbmods
Expert 5K+
P: 5,821
Changed thread title to better match contents and to remove the annoying 'help' text (don't worry; we know why you're here).

Heya, bencohen. Welcome to TSDN!

You'll be wanting to use $_GET['query'].

http://www.php.net/manual/en/languag...s.superglobals
Jun 3 '07 #2

P: 2
thanks, so how do i print that information on screen to the user. I want to put it into a form
Jun 3 '07 #3

pbmods
Expert 5K+
P: 5,821
thanks, so how do i print that information on screen to the user. I want to put it into a form
Easiest way to do it:

Expand|Select|Wrap|Line Numbers
  1. <input type="text" name="query" value="<?php echo $_GET['query']; ?>" />
  2.  
Jun 3 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.