oni-kun Posted January 18, 2010 Share Posted January 18, 2010 session_start() does not have an index, You know, I may have to say your server is at fault, I've never seen session cookies stored at /var/php_sessions before, and if you're truly not sending content before the header, then it makes no sense to show the error it has. Try using ob_start(); before session_start(); , to start output buffering and possibly fix bandaid the session setting problem. Quote Link to comment Share on other sites More sharing options...
captaintyson Posted January 18, 2010 Author Share Posted January 18, 2010 Shoulda listened to my friends when they say dont buy from ipage.com... The deal is too good to be true Quote Link to comment Share on other sites More sharing options...
oni-kun Posted January 18, 2010 Share Posted January 18, 2010 Shoulda listened to my friends when they say dont buy from ipage.com... The deal is too good to be true Yep, it seems it's just some weird server problem, many servers are misconfigured (as yours, is setting default folders to non-default areas, which are clearly not built right). Whois: "ipage.com is associated with about 605 domains" Appears they're not as big as they put out to be.. (Did you try Thorpe's code up there btw)? Quote Link to comment Share on other sites More sharing options...
captaintyson Posted January 18, 2010 Author Share Posted January 18, 2010 Oh crap, I didnt even see it. Well I'm switching to Just host as we speak so I'll get back to you when I get propagated. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 18, 2010 Share Posted January 18, 2010 Check login: <?php $host="asdfasdf.asdf.com"; // Host name $username="adsf"; // Mysql username $password="asdfadsf"; // Mysql password $db_name="asdf"; // Database name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from signup form $PID = $_POST['PID']; $pwd = $_POST['password']; $sql="SELECT * FROM `Roster` WHERE PID=$PID and pwd=$pwd"; $result=mysql_query($sql) or die(mysql_error()); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count > 0){ // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION['PID'] = $PID; $_SESSION['pwd'] = $pwd; header("location:login_success.php"); echo 'Login Worked'; } else { mysql_error(); header("location:index.php?page=crew");; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Loading</title> </head> <body> </body> </html> You're not calling session_start for check login. You need to call session_start() at the top of the script, eg <?php session_start(); $host="asdfasdf.asdf.com"; // Host name ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.