hi. i`m trying to build a website, with a user/password mysql data base. i have to mention i`m new to php.
so , i did the register form [it`s ok], the login form [ok too, selects in the data base, checking ,redirect to the new page if ok]. What i`m trying to do is show a text something like "Hello user" where user SHOULD BE kept in a cookie or something. but it`s not. Ive been burning my brains for half an hour now and i can`t figure out what`s wrong. Here`s what i tried.
i did a html form, and a validation.php file
there i have
<?php
setcookie(user, $_POST[User], time()+10000);
?>
<html>
<body>
<?php
echo $_COOKIE[user];
....
....
HERE it shows me the cookie, but when i try to redirect to the user page, where i have the SAME echo $_COOKIE[user]; ... it nologer prints the cookie on the screen. what am i missing ? this is my last hope
. thanks
so , i did the register form [it`s ok], the login form [ok too, selects in the data base, checking ,redirect to the new page if ok]. What i`m trying to do is show a text something like "Hello user" where user SHOULD BE kept in a cookie or something. but it`s not. Ive been burning my brains for half an hour now and i can`t figure out what`s wrong. Here`s what i tried.
i did a html form, and a validation.php file
there i have
<?php
setcookie(user, $_POST[User], time()+10000);
?>
<html>
<body>
<?php
echo $_COOKIE[user];
....
....
HERE it shows me the cookie, but when i try to redirect to the user page, where i have the SAME echo $_COOKIE[user]; ... it nologer prints the cookie on the screen. what am i missing ? this is my last hope