Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member toadeny's Avatar
    Join Date
    May 2003
    Location
    Wellington, New Zealand
    Posts
    188
    Member #
    1426
    Hi, i am trying to do a page in php at the moment with some if statements. I know this is possible , but how is it done.

    a have a variable from the address bar, ill just call it var for now.

    what i want to happen is, if there is nothing in the var then a section of that page loads stating plain text options for the user.

    otherwise if the var has something in it, then pass on and load the rest of the page.

    thanks in advance.

  2.  

  3. #2
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    if(!$var){
    include "somepage.php";
    }else{
    // do something...
    }
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  4. #3
    Junior Member
    Join Date
    Apr 2003
    Posts
    6
    Member #
    1156
    Originally posted by Brak
    if(!$var){
    include "somepage.php";
    }else{
    // do something...
    }
    That only works if register_globals are on. Just an FYI before you bash your head against the wall if it doesn't work as I have done.

    You should use $_GET['var'] I think.

  5. #4
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Well, I was assuming he had set $myvar = $HTTP_GET_VARS['myvar']; because he said he had a variable from the address bar, but yes your'e correct. Be VERY careful when using query strings, they're not secure worth anything. Validate validate validate!
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  6. #5
    Senior Member toadeny's Avatar
    Join Date
    May 2003
    Location
    Wellington, New Zealand
    Posts
    188
    Member #
    1426
    It dosent matter if it is secure, its just to select a products category.

    i have got round it now thanks.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:04 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com