On Sat, Jan 14, 2006 at 12:57:46PM -0500, Al wrote:
Can't get a cookie to set. Below is the code near the file top BEFORE any
html output.
...
## code
print_r($_POST)
session_start();
print_r($_COOKIE);
headers could be sent already, up your error_reporting, or check
your logs for headers
Try simplifying the problem to determine the error point. For example don't
involve $_POST just try setting a cookie with hard coded variables. If that
works then add in the $_POST and test for BOTH $_POST['prefs'] and
$_POST['filter'].
Example of simplification:
?php
// Send cookie
Jay Blanchard wrote:
But I sure would like to see the URL once he has clicked it. Have you tried
changing to $_GET['page']? Again, all of this is just for gigglesbut
there is likely to be a clue.
On privacy policies in IE (can he try another browser?) what is his setting?
I'm still
[snip]
I have not looked into it, but do some internet security apps like
Norton try to block certain cookies? I've not come across this, as I
don't really use those programs, but right now I'm grasping for straws.
[/snip]
Certain anti-virus/spyware programs can and do block cookies and can be
[snip]
Anyone have any suggestions? I'm still stuck.
[/snip]
Can you send him another test where a basic cookie gets set and then
checked?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jay Blanchard wrote:
[snip]
Anyone have any suggestions? I'm still stuck.
[/snip]
Can you send him another test where a basic cookie gets set and then
checked?
.
Not sure what you mean. I sent him to this script:
?php
if( !isset( $_REQUEST['page'] ) ) {
setcookie('VATtest','Cookie
[snip]
Not sure what you mean. I sent him to this script:
?php
if( !isset( $_REQUEST['page'] ) ) {
setcookie('VATtest','Cookie has been set.',time()+5, /);
echo 'a href='.$_SERVER['PHP_SELF'].'?page=1Test cookie./a';
} else if( $_REQUEST['page'] == '1' ) {
if( isset( $_COOKIE['VATtest'] )
Jay Blanchard wrote:
[snip]
Not sure what you mean. I sent him to this script:
?php
if( !isset( $_REQUEST['page'] ) ) {
setcookie('VATtest','Cookie has been set.',time()+5, /);
echo 'a href='.$_SERVER['PHP_SELF'].'?page=1Test cookie./a';
} else if( $_REQUEST['page'] == '1' ) {
if( isset(
[snip]
Sorry, I should have paid more attention. Is $_REQUEST['page'] correctly
set
when (print_r the array...just for giggles)
I can verify $_REQUEST is correct for me, and I'm sure it's correct for
him too, since he gets Cookie NOT set. The second if statement
requires $_REQUEST['page'] to
Chris W wrote:
I don't know that this really matters, but I am having problems with
cookies getting set when viewing my site with an old version of
netscape, I still have installed 4.79. I'm not that concerned with
supporting that old of a browser but I am 99% sure the site was
working with
Hello,
This is a reply to an e-mail that you wrote on Mon, 23 Jun 2003 at 10:18,
lines prefixed by '' were originally written by you.
I am using the following codes to create cookie and validate login,
but some
members can't login, I checked their username and password is
correct..
$info
On Thursday 13 February 2003 16:07, Terry Lau wrote:
Hello,
I created a PHP page that included cookie, here is the PHP code:
?php
if (isset($HTTP_POST_VARS['Name'])) {
setcookie(Name, $HTTP_POST_VARS['Name'], time()+86400*10);
}
[snip]
But when I called the cookie variable in another
This cannot be the problem, session_start is for sessions
Jason Wong wrote:
On Thursday 13 February 2003 16:07, Terry Lau wrote:
Hello,
I created a PHP page that included cookie, here is the PHP code:
?php
if (isset($HTTP_POST_VARS['Name'])) {
setcookie(Name, $HTTP_POST_VARS['Name'],
I always use 4 parameters in my setcookie(cookie_name,cookie_value,time,/)
Also, verify that $HTTP_POST_VARS['Name'] exists by printing it
- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 13, 2003 7:20 AM
Subject: Re: [PHP] cookie
From your code snip it looks like you are missing ? after the if
contruct.
Bryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Tue, 26 Mar 2002, andy wrote:
I am wondering if it is possible to send a cookie and read it on the same
page.
Following environment:
There is a cookie already on the machine of the client, but expired.
Now I am setting a new cookie and reading it on the same page via $sess_id =
On Tuesday, March 26, 2002, at 11:42 AM, Miguel Cruz wrote:
There is no chance for the server to re-read the cookies from the
browser
after step 2 above, unless, as you've observed, you refresh the page,
which in effect just repeats both steps.
One ugly way that I've gotten around this
Direct answer: No, you cannot read a cookie on the same page that creates
it.
The question is: why would you want to?
After all, you already have the data available to you that you would read
from the cookie because you had to use it to create the cookie on that page.
-Original
Here use this cookie that I wrote, it works in every browser, every os.
function NextYear () {
$today = gmdate(l, d-M-);
$today .= gmdate(Y)+1;
$today .= gmdate( H:i:s). GMT;
return $today;
}
$oneYear =
your header line works fine, but where are cookie files written?
i didn't see any cookie file about it in my windows/cookie directory
after it had been created??
thanks
Richard Baskett wrote:
Here use this cookie that I wrote, it works in every browser, every os.
It depends on which browser you are using and on what platform. On the
MacOS in IE you can view cookies by going to Edit - Preferences - Cookies
in Netscape you can also view the cookies with the Preferences menu. On the
PC it's a little more difficult. In IE you go to Tools - Internet Options
Thanks everyone for all the responses.
I think I'll look into sessions in the future. Meanwhile I'll have to see
what others come up with.
Thanks,
Martin S.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
I have to agree Nuno, sessions are alot easier/simpler.
--
Chris Lee
[EMAIL PROTECTED]
"Nuno Silva" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello,
short:
try removing the third parameter to setcookie and if the errors go away
you know it's a
23 matches
Mail list logo