Reading Wrox for PHP

RBX

In the zone
I've started learning PHP and found that people prefer Wrox from an old thread of this forum.

My question - Is this book really reliable ?
The page 55 here says that $path in setcookie() is used to define path where the cookie is stored. I tried experimenting to store cookie at a custom location and see what is inside cookie. When I failed after a few tries, I referenced PHP: setcookie - Manual which says something else.

Encountering an error so early in the book makes me question the correctness of this book. Is this really the right book for PHP ?
 
OP
RBX

RBX

In the zone
php.net said:
The default value is the current directory that the cookie is being set in
as far as I can guess, this suggests the directory level at which the cookie was set, so pages at similar and deeper levels within the same tree can access the cookie.


Worx said:
Path (the directory where the cookie will be saved — the default is usually sufficient; this is optional).
strikes to me as the cookie file will be saved in the directory specified in the path. I tried the method on php.net and no file was being saved.
 

krishnandu.sarkar

Simply a DIGITian
Staff member
Look where the cookie will be saved is defined in php.ini

And that path is optional parameter. If you provide the path it'll set the cookie on that path otherwise the default path that's set in php.ini

That's the thing written there, but for simplicity they should have wrote "The default value is the current directory that the cookie is being set in php.ini" to make it more comfortable.
 
OP
RBX

RBX

In the zone
w3schools says that too and I'm most comfortable with its statement. I'll leave it here as most probably this will not be thing involved in general development of website.
What I hope is that this book will present topics in a manner that I rely on it for building my foundation in PHP.
 
Top Bottom