Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

unable to read variables in PHP

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

  1. correctsearch

    correctsearch Active Member

    Sep 24, 2004
    Likes Received:
    Trophy Points:
    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

    Jan 22, 2005
    Likes Received:
    Trophy Points:
    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.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice