php-windows Digest 24 Feb 2005 02:40:35 -0000 Issue 2589
Topics (messages 25659 through 25665):
Re: Cookie Problems on Localhost
25659 by: M. Sokolewicz
25660 by: Joseph L. Mueller
25661 by: Mikey
25662 by: Mikey
25663 by: Luis Moreira
Re: not so php related
25664 by: Jason Barnett
IIS PHP 301 Redirect
25665 by: emmerse
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Joseph L. Mueller wrote:
I am testing some PHP code (example 15.5 from Sams Teach Yourself PHP
MySQL, PHP and Apache in 24 Hours). I am running running PHP 5.0.3 and
Apache 2.0.43 on my WinXp Home system.
My problem is I cannot seem to set a cookie.
<?php
setcookie("vegetable", "artichoke", time()+3600, "/", "127.0.0.1", 0);
?>
I tried using "localhost" and "127.0.0.1" for the domain parameter, but
that does not seem to work. I have tried this with botn Mozilla 1.7.3
and Internet Explorer to no avail.
both 'localhost' and any ip are not accepted as valid domain-identifiers
in cookies (as per RFC). This simply means you're best off leaving them
empty.
Any pointers would be welcome.
Thnaks in advance.
--- End Message ---
--- Begin Message ---
M. Sokolewicz wrote:
Joseph L. Mueller wrote:
I am testing some PHP code (example 15.5 from Sams Teach Yourself PHP
MySQL, PHP and Apache in 24 Hours). I am running running PHP 5.0.3
and Apache 2.0.43 on my WinXp Home system.
My problem is I cannot seem to set a cookie.
<?php
setcookie("vegetable", "artichoke", time()+3600, "/", "127.0.0.1", 0);
?>
I tried using "localhost" and "127.0.0.1" for the domain parameter,
but that does not seem to work. I have tried this with botn Mozilla
1.7.3 and Internet Explorer to no avail.
both 'localhost' and any ip are not accepted as valid
domain-identifiers in cookies (as per RFC). This simply means you're
best off leaving them empty.
Any pointers would be welcome.
Thanks in advance.
That still leaves the problem of how to test cookies and sessions on a
local system.
--
Joseph L. Mueller
--- End Message ---
--- Begin Message ---
> That still leaves the problem of how to test cookies and
> sessions on a local system.
Don't know if this will work, but have you tried setting an entry in your
hosts file (C:\WINDOWS or C:\WINNT\system32\drivers\etc) for your machine
name that points to 127.0.0.1?
Eg:
127.0.0.1 mymachine
HTH,
Mikey
--- End Message ---
--- Begin Message ---
> Don't know if this will work, but have you tried setting an
> entry in your hosts file (C:\WINDOWS or
> C:\WINNT\system32\drivers\etc) for your machine name that
> points to 127.0.0.1?
>
> Eg:
> 127.0.0.1 mymachine
Whoops! Forgot to say that you should then access your site using
http://mymachine
Mikey
--- End Message ---
--- Begin Message ---
You can always try to set a cookie, but wether the browser allows it or
not, it's a whole different ball game.
I believe your problem lies here.
Anyway, the two scripts I attach, I have just tried, and the cookie was
set by the first, WITH A MESSAGE FROM THE BROWSER ASKING IF I ALLOWED IT.
The second script read the cookie, no problem.
Hope this helps.
Luis
Mikey wrote:
That still leaves the problem of how to test cookies and
sessions on a local system.
Don't know if this will work, but have you tried setting an entry in your
hosts file (C:\WINDOWS or C:\WINNT\system32\drivers\etc) for your machine
name that points to 127.0.0.1?
Eg:
127.0.0.1 mymachine
HTH,
Mikey
--- End Message ---
--- Begin Message ---
Joakim Ling wrote:
> Hi,
>
>
>
> Is there a way to add hosts in IIS6 and alias in DNS hosts from php or
> cmd. It would help me alot when I register a new customer.
>
>
In an Apache server you would use VirtualHosts... but then again I have
never used IIS so who knows what they call it on that server ;)
>
> I know its not php related but if someone know please share.
>
>
>
> cheers
>
> Jocke
>
>
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
signature.asc
Description: OpenPGP digital signature
--- End Message ---
--- Begin Message ---
Hi,
I am having problem with PHP header location with IIS 6.0. Even after i sent
the
header("HTTP/1.1 301 Moved Permanently");
the
header (Location: url);
always return 302 redirect.
any solution to this problem?
Thanks.
Jack Sen
--- End Message ---