snteran Posted September 23, 2005 Posted September 23, 2005 I need to create a login page for admin use. I created this page and need help. Again, it works fine on my test box, but when I upload and change some of the includes, it does not work. I try not to use php 5 specific code, but not totally sure what is php 5 or php 4. Any help is greatly appreciated. <?php include_once('../conf/main.conf.php'); //session_start(); $lerrorMessage = null; ?> <?php $username = $_POST['username']; $password = $_POST['password']; $username = stripslashes($username); $password = stripslashes($password); if((!$username) || (!$password)){ if(!$username){ $uerrorMessage .="Please verify your username."; } if(!$password){ $perrorMessage .="Please verify your password."; } include 'login.php'; // Show the form again! /* End the error checking and if everything is ok, we'll move on to creating the user account */ exit(); // if the error checking has failed, we'll exit the script! } $password = md5($password); $handle = db_connect(); $db_selected = mysql_select_db('myvnyuol_myvnyuolloca', $handle); if (!$db_selected) { die ('Could not select database LOC: ' . mysql_error()); } // check if the user info validates the db $sql = mysql_query("SELECT * FROM writers WHERE username='$username' AND password='$password'"); if(!$sql){ $lerrorMessage .="Contact your system administrator, there is an access error."; exit; } include 'login_2.php'; $login_check = mysql_num_rows($sql); if($login_check > 0){ while($row = mysql_fetch_array($sql)){ foreach( $row AS $key => $val ){ $$key = stripslashes( $val ); } // Register some session variables! //session_register('username'); //$_SESSION['username'] = $username; header("Location: submit.html"); } } else { include 'login_2.php'; } ?> Basically I want the submit.html page to come up. After that, I'm sure I'll have more questions. The Submit page will be used to insert stories for the website. thanks for the help, Serge Quote
TweezerMan Posted September 24, 2005 Posted September 24, 2005 I don't see anything obviosly wrong, but the problem could be with one of the files you're including. What problem are you having when you try to run the script on the server? Quote
snteran Posted September 24, 2005 Author Posted September 24, 2005 The login page keeps coming up with no errors. I am going to try to clean up some of the code and try a cleaner include page. And if that does not work, perhaps I can get some help on creating some better error handeling pages. Quote
snteran Posted October 5, 2005 Author Posted October 5, 2005 The login page keeps coming up with no errors. I am going to try to clean up some of the code and try a cleaner include page. And if that does not work, perhaps I can get some help on creating some better error handeling pages. I cleaned up my code and made sure to use php 4.3 code and my page now works. thanks, Sergio Quote
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.