note 68161 added to function.setcookie
| From: | denito19 at gmail dot com | Date: | Sun, 16 Jul 2006 10:36:30 +0000 |
| Subject: | note 68161 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-114813@lists.php.net to get a copy of this message | ||
Please, if somebody can help me... thanks!
BTW: I'm new at the whole cookie thing, I've been programming, for 7 years now, I'm
better in Visual Basic and stuff like that...
Well, I'm doing it all separate, because of the whole headers thing...
I have a page called procesos.html in which I have a form, the value of username and password are
asked there..
Then I pass those values to another .php that takes charge of the MySql instructions,
then if it all works fine it goes to a third page in which I set the cookie
Then I go back to procesos.html and it shows, username = "user" but when I click any of my
others links
It goes blank again as if no cookie had been set.. but if I go back to the page it's back
again, even if I reload it, it's back again
This is the Check.php that does the mysql instructions
$queryupdate = "select * from users where nombre = '$nombre' and clave =
'$clave'";
$resultupdate = mysql_query($queryupdate);
$numberupdate = mysql_numrows($resultupdate);
$tipo= mysql_result($resultupdate,0,"tipo");
if ($numberupdate==1) {
redirect("enter.php?nombre=$nombre&tipo=$tipo");
}else{
redirect("procesos.html");
}
Then it goes to enter.php
setcookie("name", $nombre,time()+3600, "/");
setcookie("acepto", 1,time()+3600, "/");
setcookie("tipo", $tipo,time()+3600, "/");
I've tried with no time, and no path, it doesn't work... :S
It worked until I added the MySql thing... I mean, with a username variable, and a password
variable it worked..
something like this, If ($name = "user" && $password ="1234") then go
in, and it worked fine
If somebody can help me I greatly appreciate it!!!!
----
Server IP: 201.248.247.234
Probable Submitter: 200.84.156.32
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- http://master.php.net/note/edit/68161
Del: integrated -- http://master.php.net/note/delete/68161/integrated
Del: useless -- http://master.php.net/note/delete/68161/useless
Del: bad code -- http://master.php.net/note/delete/68161/bad+code
Del: spam -- http://master.php.net/note/delete/68161/spam
Del: non-english -- http://master.php.net/note/delete/68161/non-english
Del: in docs -- http://master.php.net/note/delete/68161/in+docs
Del: other reasons-- http://master.php.net/note/delete/68161
Reject -- http://master.php.net/note/reject/68161
Search -- http://master.php.net/manage/user-notes.php