PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
if(!$_COOKIE[($this->sitedata['cookie']).'user']) {
setcookie (($this->sitedata['cookie']).'user', $this->sitedata['dbuser']);
}
if(!$_COOKIE[($this->sitedata['cookie']).'pass']) {
setcookie (($this->sitedata['cookie']).'user', $this->sitedata['dbpass']);
}
// Check if the cookie has been created
echo $_COOKIE[($this->sitedata['cookie']).'user'];
echo $_COOKIE[($this->sitedata['cookie']).'pass'];
I've tried that and it does have a refresh delay problem. What is the HTML to command a refresh (can that be done, I'm thinking, set a cookie and command the page to reload)
or also JS' location, or finally a meta refresh....
edit: the problem using header() is that it sends info down to the client and will therefore cause an error unless you're using output buffering
edit2: doh! guess I was wrong, I thought that by sending cookie down, you'd get header already sent probs...(could've sworn I had that prob in the past) apparently not, just tested and it worked fine.