Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

dreamweaver login forms

login form not working

12:35 am on Apr 23, 2009 (gmt 0)

New User

5+ Year Member

joined:Apr 22, 2009
posts: 2
votes: 0

I've created a normal php login page with mysql user table, it works fine on my local host xampp or apache2traid but when i upload it to server it doesn't work !

I'm using a session variables in code
and my php and sql on xampp is the same as web server

how can i get this to work

12:39 pm on Apr 23, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 10, 2006
votes: 0

You must always provide the code and error when you request assistance. This will help all those experts to identify where the problem is and provide you with a solution response.

As you have not provided the above, I would suggest you check if your server is php enabled.

4:22 pm on Apr 23, 2009 (gmt 0)

New User

5+ Year Member

joined:Apr 22, 2009
posts: 2
votes: 0

Ah, I'm sorry i didn't know that ..

the index code :

<?php require_once('Connections/connection.php'); ?><?php
// *** Validate request to login to this site.

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck;

if (isset($_POST['username'])) {
$MM_fldUserAuthorization = "level";
$MM_redirectLoginSuccess = "teacher.php";
$MM_redirectLoginFailed = "badlogin.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_connection, $connection);

$LoginRS__query=sprintf("SELECT username, passwod, level FROM users WHERE username='%s' AND passwod='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));

$LoginRS = mysql_query($LoginRS__query, $connection) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {

$loginStrGroup = mysql_result($LoginRS,0,'level');

//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;

//register the session variables

if (isset($_SESSION['PrevUrl']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
header("Location: " . $MM_redirectLoginSuccess );
else {
header("Location: ". $MM_redirectLoginFailed );
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<script type="text/javascript" src="splashpage.js">

* Splash Page script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

<title>Your Elementary School</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="enter, keywords, here">
<meta name="description" content="enter brief description">
<style type="text/css">
a:link {
color: #660000;
.style5 {font-size: 14px}
body {
background-image: url(images/background.jpg);
.style6 {color: #FF0000}
.style7 {font-family: Tahoma}
.style8 {
font-size: 10pt;
color: #0000CC;
.style9 {
color: #FF0000;
font-size: 16pt;
font-weight: bold;
<body vlink="#FFFFCC" alink="#FFFF00">
<div align="center">
<table width="800" height="600" border="0" background="images/demo.jpg">
<td><form action="<?php echo $loginFormAction; ?>" method="POST" name="login_form" id="login_form">
<table width="291" border="0" align="center" cellpadding="2" cellspacing="0">
<td width="40%"><span class="form">Username</span></td>
<td><input name="username" type="text" id="username2" size="25"></td>
<td width="40%"><span class="form">Password</span></td>
<td><input name="password" type="password" id="password2" size="25"></td>
<td colspan="2" class="style7"><div align="center">
<table width="200">
<input name="selecttype" type="radio" value="1" checked>
<td><input type="radio" name="selecttype" value="2">
<td class="style7"><input name="login" type="submit" id="login2" value="Sign In"></td>
<td><span class="style5"><a href="register.php" class="style6">New User</a> - Forget Password </span></td>



Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members