Thread: querystrings

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    4
    Rep Power
    0
    im a total newbie at php.
    since i usualy do asp for serverside i tried to read the php4 manual and installed php4 for win32.
    anyway... how the !#% do u write a simple querystring on the page???
    I tried this:
    <font face='verdana,arial,geneva' size='1' color='#336699'><b>
    <?php if (!$QUERY_STRING) {
    echo "no querystring!<br><a href='querystring.php?now it works'>create one here</a>";
    } else {
    echo $QUERY_STRING;
    } ?><br>
    </font>

    ------------------
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    you can do this in two ways..
    first one is that...just pass the value with url...

    <a href="yourscript.php?blabla">click here</a>

    you can process this like follows
    (i am using empty() function to check wether the value is their or not)

    <?php
    if (empty($QUERY_STRING)) {
    //query string is empty..

    echo "no querystring!<br><a href='querystring.php?ok'>create one here</a>";
    } else {
    echo $QUERY_STRING;
    } ?><br>
    </font>


    ----------
    second way is pass the value to a variable..
    (both same as Asp)

    <a href="yourscript.php?variable=blabla">click here</a>



    <?php
    if (!$variable) {
    //No variable value...

    echo "no querystring!<br><a href='querystring.php?ok'>create one here</a>";

    } else {
    echo $variable;

    } ?><br>
    </font>


    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."

    [This message has been edited by Shiju Rajan (edited September 28, 2000).]

Similar Threads

  1. Querystrings
    By socomdude in forum PHP Development
    Replies: 7
    Last Post: September 18th, 2003, 10:37 PM
  2. QueryStrings?
    By Culpepper in forum PHP Development
    Replies: 3
    Last Post: June 1st, 2002, 02:32 PM

IMN logo majestic logo threadwatch logo seochat tools logo