is this php page have any wrongs ?

kurdistanboy

New member
please i need help i have crated login page with Dreamwaver CS4 and it is working in xamp but it is don't working in the Website this is the code :
<?php require_once"../Connections/mc1.php"; ?>
<?php
if (!function_exists(GetSQLValueString)) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_mc1, $mc1);
$query_loginmn = "SELECT * FROM `admin`";
$loginmn = mysql_query($query_loginmn, $mc1) or die(mysql_error());
$row_loginmn = mysql_fetch_assoc($loginmn);
$totalRows_loginmn = mysql_num_rows($loginmn);
?>
<?php
// *** Validate request to login to this site.
if (isset($_SESSION[loginshb])) {
session_start();
}
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "AdminPage.php";
$MM_redirectLoginFailed = "index.php?failed=ture";
$MM_redirecttoReferrer = true;
mysql_select_db($database_mc1, $mc1);
$LoginRS__query=sprintf("SELECT username, password FROM `admin` WHERE username=%s AND password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));

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

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

if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<!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" dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<style type="text/css">
<!--
#form1 table tr td {
text-align: center;
}
#form1 table {
font-size: 18px;
}
-->
</style>
<link href="../ssf/default.css" rel="stylesheet" type="text/css" />
</head>

<body>
<form id="login" name="login" method="POST" action="<?php $_SERVER[PHP_SELF]; ?>">
<div align="center">
<table border="1" width="572" style="border-collapse: collapse; border: 1px dashed #005FEC; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" background="../Images/Kurdwave.png" bordercolor="#005FEC" id="table1" height="147" cellspacing="0" cellpadding="0">
<tr>
<td width="568" height="145">*??????:<span lang="ar-kw">********
</span><input type="text" name="username" id="username" width="200" size="54" style="background-color: #99CCFF" /><p>*<span lang="ar-kw">?????
?????</span>:<span lang="ar-kw"> </span><input type="password" name="password" id="pas
 
Back
Top