Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
  • Keywords in the URL (In: General Search Engine Optimization)
  • how to get music url? (In: General Search Engine Optimization)
  • Featured Web Site Template

    Hundreds More at Free Site Templates.com!

    Web Site Partners
    Sponsored Links
    Jet City Software
     
    Whos Here ?
    There are 0 guests and 1 members in the forums right now.
    Reflects user activity within the last 5 minutes
    Moderator(s): Prowler, jcokos
    Member Message

    gostly
    Joined: Apr 06, 2004
    # Posts: 5

    View the profile for gostly Send gostly a private message

    Posted: 2004-Jul-07 23:09
    Edit Message Delete Message Reply to this message

    i just switched servers, and before everything worked out just fine...but now i have pages like...

    profile.php?id=2

    but it's treating it as if it's not picking up the $id after the ?...although it used to on our other server...so i was thinking my settings arent right or maybe im using the wrong version of something, my current php version is 4.3.6...but i dont know where to look to try to fix the problem



    jcokos
    Staff
    Joined: Eons Ago
    # Posts: 143

    View the profile for jcokos Send jcokos a private message

    Posted: 2004-Jul-08 20:40
    Edit Message Delete Message Reply to this message

    Your new server is (correctly) setup with REGISTER GLOBALS turned off.

    With that off, variables in the URL, such as your "id=2" are not automatically turned into $id. Rather, you'll have to reference them by the global variable $_GET .... ie:

    $_GET['id'] should be set to "2" now.

    You can get around this by doing something like this at the top of your script:



    Code: [copy]





    However, this defeats the purpose of having the automatic registration of those variables off. You should do some error and sanity checking on them before making them global as I showed above.



    mincklerstraat
    Joined: Eons Ago
    # Posts: 10

    View the profile for mincklerstraat Send mincklerstraat a private message

    Posted: 2004-Sep-16 18:37
    Edit Message Delete Message Reply to this message

    might also work with :


    Code: [copy]




    and note the two $$ in front of var.
    jcokos's might be safer though
    If you can't find any nice, central place to put this, like in a config file or something, you can look at the auto prepend stuff in php, put that in your .htaccess file.

    check to see if your script has got a new version that doesn't have to work with register globals turned on - if you can upgrade, you will probably be more secure, and won't have to do all this.



    You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
    1. You have not yet logged in, or registered properly as a member
    2. You are a member, but no longer have posting rights.
    3. This is a private forum, for which you do not have permissions.

    If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

    If you cannot find this message, click here to Re-Send it.

    If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

    Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

    New posts Forum is locked
    © 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions