gmz1023 Posted January 5, 2010 Share Posted January 5, 2010 Hey guys. I've googled the ###### out of this error and still can't get it to work. i get this error Warning: Cannot modify header information - headers already sent by (output started at /home1/secregco/public_html/test/inc/functions.php:3) in /home1/secregco/public_html/test/login.php on line 24Warning: Cannot modify header information - headers already sent by (output started at test/inc/functions.php:3) in /test/login.php on line 25 whenever i try to log in to my site. it does send me to the correct page afterwords but the fact that i'm getting an error isn't good. (duh).this is the functions.php <?php function redirect($parm,$title="") {?><meta http-equiv="refresh" content="2;url=<?php print($parm); ?>"><link href="assetts/misc.css" rel="stylesheet" type="text/css"><body bgcolor="#fff" text="#ffffff"><table id="please"> <tr> <th>System Message</th> </tr> <tr> <td> Please wait while we redirect you. </td> </tr> <?php }?></table> this is the login.php <?php require("inc/functions.php");if((!isset($_GET["user"])) && (!isset($_GET["pass"])) ){redirect("index.php"); exit;}$user=$_GET["user"];$pass=$_GET["pass"];$fp=fopen("inc/users.db","r");$userdata=array();$redirect="";while (($userdata = fgetcsv($fp, 1000, ",")) !== FALSE){if (($userdata[0]==$user) && ($userdata[1]==$pass)){ $redirect=$userdata[2]; }}fclose($fp);if ($redirect==""){redirect("index.php","Security Check : Fail");}else{setcookie("user",$user,time()+3600,"/"); setcookie("pass",$pass,time()+3600,"/");redirect($redirect,"index.php?hmb=wru");}exit;?><body><pre>User entered :<?php print ($user . "/" . $pass); if ($redirect<>"") {print("OK -> ".$redirect); } else {print("KO -> index"); } for ($i=0;$i<count($userdata);$i++) { print($userdata[0] . "|" . $userdata[1] . "|" . $userdata[2] . "\n" ); } ?></pre> anyhelp would be appreciated. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 5, 2010 Share Posted January 5, 2010 Check here:http://w3schools.invisionzone.com/index.ph...ost&p=96607 Link to comment Share on other sites More sharing options...
Redroest Posted January 5, 2010 Share Posted January 5, 2010 This warning is a nice example of using php in the wrong order. You have to MAKE the website and proces query's first using php. In the ideal situation your last php outputs the entire website in one line Link to comment Share on other sites More sharing options...
gmz1023 Posted January 5, 2010 Author Share Posted January 5, 2010 thanks guys! fixed it Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.