|
Posted by J.O. Aho on 12/31/05 18:17
Micha Biegnole wrote:
> I want to learn php and mysql (with apache). I have a book still from
> school, but it's php4. Should I buy a new book for php5? (I still use
> windows 98 se).
It works fine, most of the things that works for PHP4 works for PHP5 too.
If the book is written before the release of PHP 4.1.0, then it will be using
older global variables, but you should replace those with the new ones:
$HTTP_SERVER_VARS -> $_SERVER
$HTTP_ENV_VARS -> $_ENV
$HTTP_COOKIE_VARS -> $_COOKIE
$HTTP_GET_VARS -> $_GET
$HTTP_POST_VARS -> $_POST
$HTTP_POST_FILES -> $_FILES
$HTTP_SESSION_VARS -> $_SESSION
Then you have that there used to be the register_globals was turned on (see
your php.ini), but nowadays is by default turned off due security issues. So
they may not translate the inbound values to variables and use the variables
directly in the code, you may need to add:
$variable_name=$_REQUEST['variable_name'];
in the top of your code, one such line for each variable that are sent to the
php script.
//Aho
[Back to original message]
|