Jump to content

Help With Login Page


Recommended Posts

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.





$lerrorMessage = null;




$username = $_POST['username'];

$password = $_POST['password'];



$username = stripslashes($username);

$password = stripslashes($password);



if((!$username) || (!$password)){


$uerrorMessage .="Please verify your username.";



$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'");


$lerrorMessage .="Contact your system administrator, there is an access error.";



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['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,



Link to comment
Share on other sites

  • 2 weeks later...
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.





Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...