Results 1 to 6 of 6

Thread: problem using PHP

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2003
    Posts
    237

    problem using PHP

    hi,

    i tried my php on IIS n apache2,
    when i try to do this
    http://localhost/index.php?product_name=abcdef

    in my script, $product_name will not appear as abcdef, why?


    P/S: when i using phpMyAdmin, it did not give me the problem

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    You are probably running in safe mode or with register globals off..... both settings wich ensure a safer running machine.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2003
    Posts
    237
    there is no problem if i use

    echo $_REQUEST['product_name'];

    but why i can't use $product_name strightly?


    register globals off?
    can u teach me how to solve this problem?

    im running apache2 or iis only win2k pro.

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    turning Register Globals on is a very dangerous thing to do... in fact no one that I know of would recommend turning it on.....
    Your best bet is to use
    $product_name = $HTTP_GET_VARS['product_name'];
    The reason being is that it prevents someone from junking up your URL and running unauthorized code on your machine. The ability to use the globals in the manner you mentioned was from older version and is only included as a depreciation method. If you are running anything newer that 4.0, I'd use the HTTP_GET_VARS, it's simply safer.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2003
    Posts
    237
    i get what your meant~!

    thanks,
    i thought my web server problem, i try to reinstall many times.
    =P

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I'm still confused about why everyone wants to avoid using $_POST['variable'].

    And try to use $_POST and $_GET as much as possible. Only use $_REQUEST if it may come by either method.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

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



Click Here to Expand Forum to Full Width