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!
when i try to set 2 cookies i'm gettign this error
Warning: Cannot add header information - headers already sent by (output started at /home/dragonsb/public_html/cbaa/header.php:3) in /home/dragonsb/public_html/cbaa/l.php on line 13
Warning: Cannot add header information - headers already sent by (output started at /home/dragonsb/public_html/cbaa/header.php:3) in /home/dragonsb/public_html/cbaa/l.php on line 14
<?PHP
$dbh = mysql_connect ("localhost", "___", "___") or die ('I cannot connect to the database.');
mysql_select_db ("dragonsb_xmb1");
$qry = mysql_query("SELECT * FROM users WHERE login = '$login' AND pass = '$password'");
if (mysql_num_rows($qry) == 1){
setcookie ("idcbaa",$id,time()+604800,"/");
setcookie ("logcbaa",$stat,time()+604800,"/");
$row = mysql_fetch_assoc($qry);
$stat = $rowї'status'];
$id = $rowї'id'];
the code goes on after that... but could it be the fact, that i use this page as a sumbit result, i use a form to get login and pass then when you submit it code to this page
Are you including a header.php file before using the setcookie function? The code you pasted in your last post should be the very first thing in the file before any other code or HTML.
There is your problem, you sent HTML before setting the cookie, you can't do that. You need to set a cookie before ANY HTML tags have been sent, and before PHP has done anything to the page itself(echo'ing text to it, etc).
oh... i got an idea can you add another page onto a form.... like the action would be one thing... there would be a hidden or somethign..... well just an idea