PHP4 book still usefull?

PHP4 book still usefull?

am 31.12.2005 16:05:42 von michabig

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).

Re: PHP4 book still usefull?

am 31.12.2005 16:58:45 von Marian Heddesheimer

On Sat, 31 Dec 2005 16:05:42 +0100, 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).

PHP4 is still fine for learning the basic stuff (if its not too old).
Look if it's explaining Internet Forms using $_POST and $_GET instead
of global variables or $HTTP_POST_VARS (that's outdated).

PHP5 is great if you want to build larger object oriented
applications, because OOP support is much better in PHP5 than in 4.

In my online courses I already teach PHP4 for that reason. PHP5 will
be a separate course which will cover OOP in greater depht. But to
understand the important things like Forms and Sessions, PHP4 will do
fine.

Marian

Re: PHP4 book still usefull?

am 31.12.2005 17:17:53 von Shion

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