Help With Login Page

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.<br /><br /><?php<br />include_once('../conf/main.conf.php');<br />//session_start();<br />$lerrorMessage = null;<br />?><br /><br /><?php<br />$username = $_POST['username'];<br />$password = $_POST['password'];<br /><br /><br />$username = stripslashes($username);<br />$password = stripslashes($password);<br /><br /><br />if((!$username) || (!$password)){<br /> if(!$username){<br /> $uerrorMessage .="Please verify your username.";<br /> }<br /> if(!$password){<br /> $perrorMessage .="Please verify your password.";<br /> }<br /> include 'login.php'; // Show the form again!<br /> /* End the error checking and if everything is ok, we'll move on to<br /> creating the user account */<br /> exit(); // if the error checking has failed, we'll exit the script!<br />} <br /><br />$password = md5($password);<br /><br />$handle = db_connect();<br /><br />$db_selected = mysql_select_db('myvnyuol_myvnyuolloca', $handle);<br />if (!$db_selected) {<br /> die ('Could not select database LOC: ' . mysql_error());<br />}<br />// check if the user info validates the db<br />$sql = mysql_query("SELECT * FROM writers WHERE username='$username' AND password='$password'");<br />if(!$sql){<br /> $lerrorMessage .="Contact your system administrator, there is an access error."; <br />exit;<br />}<br />include 'login_2.php';<br /><br />$login_check = mysql_num_rows($sql);<br /><br />if($login_check > 0){<br />while($row = mysql_fetch_array($sql)){<br />foreach( $row AS $key => $val ){<br />$$key = stripslashes( $val );<br />}<br />// Register some session variables!<br />//session_register('username');<br />//$_SESSION['username'] = $username;<br /><br />header("Location: submit.html");<br />}<br />} else {<br />include 'login_2.php';<br />}<br />?><br /><br />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.<br /><br />thanks for the help,<br /><br />Serge<!--content-->
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?<!--content-->
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.<!--content-->
<!--quoteo(post=149955:date=Sep 24 2005, 11:32 AM:name=snteran)--><div class='quotetop'>QUOTE(snteran @ Sep 24 2005, 11:32 AM) <a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=149955"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><div class='quotemain'><!--quotec-->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.<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br /><br />I cleaned up my code and made sure to use php 4.3 code and my page now works.<br /><br />thanks,<br /><br />Sergio<!--content-->
Glad you got it working Sergio <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/thumbup1.gif" style="vertical-align:middle" emoid=":thumbup1:" border="0" alt="thumbup1.gif" /><!--content-->
 
Back
Top