Jump to content


Photo

question about this


  • Please log in to reply
4 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 18 April 2006 - 01:40 AM

this first
Name
Functionality

$GLOBALS
Contains all global variables in your script, including other superglobals. This is not generally recommended for use, unless you are, for some reason, not sure where a variable will be stored. $GLOBALS has been available since PHP 3, and its operation has not changed.

$_GET
Contains all variables sent via a HTTP GET request. That is, sent by way of the URL. Users of older PHP versions will recognise this as being the same as $HTTP_GET_VARS array, which, although deprecated, is still available for use.

$_POST
Contains all variables sent via a HTTP POST request. This is similar to the old $HTTP_POST_VARS array, which, although deprecated, is still available for use.

$_FILES
Contains all variables sent via a HTTP POST file upload. This is similar to the old $HTTP_POST_FILES array, which, although deprecated, is still available for use.

$_COOKIE
Contains all variables sent via HTTP cookies. This is similar to the old $HTTP_COOKIE_VARS array, which, although deprecated, is still available for use.

$_REQUEST
Contains all variables sent via HTTP GET, HTTP POST, and HTTP cookies. This is basically the equivalent of combining $_GET, $_POST, and $_COOKIE, and is less dangerous than using $GLOBALS. However, as it does contain all variables from untrusted sources (that is, your visitors), you should still try to steer clear unless you have very good reason to use it. There's no equivalent to $_REQUEST in versions of PHP before v4.1.

$_SESSION
Contains all variables stored in a user's session. This is similar to the old $HTTP_SESSION_VARS array, which, although deprecated, is still available for use.

$_SERVER
Contains all variables set by the web server you are using, or other sources that directly relate to the execution of your script. This is similar to the old $HTTP_SERVER_VARS array, which, although deprecated, is still available for use.

$_ENV
Contains all environment variables set by your system or shell for the script. This is similar to the old $HTTP_ENV_VARS array, which, although deprecated, is still available for use.

BACK TO ME-Some of these are deprecated so I don't care about those, but with these specifically, does this mean that every variable under those sections are all stored in that information

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 18 April 2006 - 01:57 AM

Well, I am not understanding your question. About the deprecated names:

$HTTP_POST_VARS['donut'] is the same as $_POST['donut']

But if I can remember well, the old vars weren't global, meaning that you had to use global $HTTP_POST_VARS when calling them in a function for example
~ D Kuang

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 18 April 2006 - 02:00 AM

Oh so then I will just replace the old deprecated tags for the newer versions. Thanks,

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 18 April 2006 - 08:48 AM

If you want to see what they all contain

echo '<pre>', print_r ($GLOBALS, true), '</pre>';

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 18 April 2006 - 05:12 PM

thanks

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users