The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

unable to read variables in PHP

Discussion in 'General Discussion' started by correctsearch, Aug 2, 2006.

  1. correctsearch

    correctsearch Active Member

    Joined:
    Sep 24, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    My website has php script which use to read data posted as form variable to url variable by simplyusing $variable_name.

    Recently I have restored my server and these scripts no longer work. It also does not give any error message. I have tried to degubg the code by printing these varibale then I have noticed that the varibale can only be read by using HTTP_GET_VARS or HTTP_POST_VARS.

    Does someone can help me what do I need to change so that the varibales can be read without using HTTP functions? It is used to work in the past.
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    You'll need to enable a feature called register_globals, however doing so introduces a few security concerns with the short answer being that you're better off with register_globals disabled.

    Just stick with HTTP_POST_VARS and HTTP_GET_VARS, or preferably $_POST and $_GET, as this is much more secure.
     
Loading...

Share This Page