Outputting $_GET variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bencohen
    New Member
    • Jun 2007
    • 2

    Outputting $_GET variables

    I'm having a complete block on something simple:

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

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

    Cant remember how to do that
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    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'].

    Comment

    • bencohen
      New Member
      • Jun 2007
      • 2

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

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Originally posted by bencohen
        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:

        [code=html]
        <input type="text" name="query" value="<?php echo $_GET['query']; ?>" />
        [/code]

        Comment

        Working...