SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Smart programmer silver trophy M.Zeb Khan's Avatar
    Join Date
    Jan 2004
    Location
    Luton, Beds
    Posts
    1,792
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Request.QueryString in PHP...??

    Hey!

    I am a Newbie to PHP....

    For Example.. we have a page with name "page.asp"
    Like in ASP we do Request.QueryString("show") and it opens:
    pages.asp?show=

    How can i do it in PHP?

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you have page.php?show=hello then $_GET['show'] will be 'hello'

  3. #3
    Smart programmer silver trophy M.Zeb Khan's Avatar
    Join Date
    Jan 2004
    Location
    Luton, Beds
    Posts
    1,792
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    markl999!! Thanks.....

    Anyway i got Detail at:
    http://www.w3schools.com/php/php_forms.asp

    Thanks...

  4. #4
    Non-Member hyperimage's Avatar
    Join Date
    Dec 2003
    Location
    Croatia
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hi

    this one is right:
    main file
    PHP Code:
    <?php
    $action 
    $_GET['act'];
      if (
    $act == 'draw') { 
        
    draw_step1(); 
    }
    ?>
    HTML Code:
    <a href="page.php?act=draw">Hello</a>
    PHP Code:
    <?php
    function draw_step1()
    {
    ?>
    <h3>Lazy dog jump over the little brown fox</h3>
    <?
    }
    ?>
    cya
    Last edited by hyperimage; Feb 22, 2004 at 03:38.

  5. #5
    Now with customized title Jump's Avatar
    Join Date
    Sep 2002
    Location
    The Restaurant at The End of The Universe
    Posts
    1,423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $HTTP_GET_VARS['action'] is the old way of doing it.

    $_GET['action'] is the proper way now.

  6. #6
    Non-Member hyperimage's Avatar
    Join Date
    Dec 2003
    Location
    Croatia
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok sorry man.....
    i hope that the concept was right............
    isnt it...................
    <>>><><><<><>><<><<><><>>><><<>><<>>>>fishing!!!!!!
    by the way u learned to write!!!!(restaurant)!!!
    lol

  7. #7
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Southern Maine
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a way to add a link to this code:

    PHP Code:

    <?php 
    $action 
    $_GET['act']; 
      if (
    $act == 'draw') { 
        
    draw_step1(); 

    ?>
    To make like category script, etc. I know you can do the HTML link. Would an array work with that? To have the urls?
    Working on a new CSS site for RKS and PHP driven?

    Looking for staff, tutorial site for coding, and photshop. PM me.

  8. #8
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, if you want the whole Query string, you can use
    PHP Code:
    $_SERVER['QUERY_STRING'
    Also, in the example provided by hyperimage, he made a typo in his conditional, it should be
    PHP Code:
    if ($action == 'draw'
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •