I had dynamic webpages designed with php and sql. I move my root files from C:\wamp\www\Mentor Mentee System\ to another PC and redo the connection. But, I am having undefined index error in C:\wamp\www\Mentor Mentee System\index.php on line 205. How should I deal with this error?
My scripts as below:
<?php require_once('Connections/connection.php'); ?>
<?php include('Connections/myconnection.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;
}
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['admin_id'])) {
$loginUsername=$_POST['admin_id'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "student_id";
$MM_redirectLoginSuccess = "manage_student.php?student_id=$loginUsername";
$MM_redirectLoginFailed = "index.php?error=e";
$MM_redirecttoReferrer = true;
mysql_select_db($database_connection, $connection);
$LoginRS__query=sprintf("SELECT student_id, student_pass, student_id FROM student WHERE student_id=%s AND student_pass=%s",
GetSQLValueString($loginUsername, "int"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $connection) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'student_id');
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
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 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FENG Mentor Mentee System</title>
<style type="text/css">
</style>
<script type="text/javascript" src="image/swfobject.js"></script>
<script type="text/javascript" src="image/prototype.js"></script>
<script type="text/javascript" src="image/scriptaculous.js"></script>
<script type="text/javascript" src="image/effects.js"></script>
<script type="text/javascript" src="image/lightbox.js"></script>
<link rel="stylesheet" href="image/lightbox.css" type="text/css" media="screen">
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationPassword.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryValidationPassword.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="image/clogo.PNG" type="image/x-icon"/>
</head>
<body background="image/background.jpg">
<!-- BodyFrame -->
<table width="1250" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<!-- Banner -->
<tr>
<td width="1250" height="120" align="center" valign="top" background="image/banner.jpg" bgcolor="#999999"></td>
</tr>
<!-- Banner -->
<!-- TopBorder -->
<tr>
<td height="23" bgcolor="#408080"></td>
</tr>
<!-- TopBorder -->
<!--BodyMenuOut-->
<tr>
<td>
<table width="1250" align="center" valign="top">
<!--BodyMenuIn-->
<tr>
<!--BodyMenuLeft-->
<td width="410" align="center" valign="top">
<table width="420" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="420" height="18">
<!--BorderGray-->
<table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="420" height="23" bgcolor="#999999" style="font-size: 12px"></td>
</tr>
</table>
<!--BorderGray-->
</td>
<tr><!--XXX-->
<td width="420" align="left" valign="top">
<form action="<?php echo $loginFormAction; ?>" method="POST" name="frmLogin" id="frmLogin" style="font-size: 12px;">
<table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
<!--StudentLecturer-->
<tr>
<td height="32" colspan="4">
<strong>
[<a href="index.php" style="color:#004080; font-size: 13px">Student</a>]
[<a href="login_lecturer.php" style="color:#004080; font-size: 13px">Lecturer</a>]</strong></td>
</tr>
<!--StudentLecturer-->
<!--LoginStudent-->
<tr bgcolor="#408080">
<td height="23" colspan="4"> <strong style="color: #FFF; font-size: 13px;"> Login Student</strong></td>
</tr>
<!--LoginStudent-->
<tr>
<td height="6" colspan="4"></td>
</tr>
<!--UserID-->
<tr bgcolor="#D6F5F5">
<td width="40" height="23"></td>
<td width="75" height="23"><strong style="color: #004080; font-size: 12px;">UserID</strong></td>
<td width="15"><strong style="color: #004080; font-size: 12px;">/strong></td>
<td width="290" style="font-size: 12px">
<span id="sprytextfield1">
<label>
<input style="font-family: Verdana, Geneva, sans-serif; font-size: 11px; color: #009;" name="admin_id" type="text" id="admin_id" size="11" maxlength="100" />
</label>
</span>
</td>
</tr>
<!--UserID-->
<!--Password-->
<tr bgcolor="#FFFFCC">
<td width="40" height="23"></td>
<td width="75" height="23"><strong style="color: #004080; font-size: 12px;">Password</strong></td>
<td width="15" height="23"><strong style="color: #004080; font-size: 12px;">/strong></td>
<td width="290" style="font-size: 12px">
<span id="sprypassword1">
<label>
<input style="font-family: Verdana, Geneva, sans-serif; font-size: 11px; color: #009;" name="password" type="password" id="password" size="11" maxlength="100" />
</label>
</span>
</td>
</tr>
<!--Password-->
<tr>
<td height="6" colspan="4"></td>
</tr>
<!--LoginButton-->
<tr>
<td height="21" colspan="3"></td>
<td width="290" height="21">
<label>
<input type="image" src="image/button_login.gif" name="Login" id="Login" value="Login" />
</label>
</td>
</tr>
<!--LoginButton-->
</table>
<!--InvalidUser-->
<?php if($_REQUEST['error']==e){?>
<table width="300" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="300" height="5" colspan="2"></td>
</tr>
<tr>
<td width="40" height="3"></td>
<td width="260" height="3" bgcolor="#FFCCCC"></td>
</tr>
<tr>
<td width="40" height="20"></td>
<td width="260" height="20" bgcolor="#FFCCCC" style="color:#C00; text-align:center; font-weight: bold; font-size: 12px;">Invalid UserID or Password !!!</td>
</tr>
<tr>
<td width="40" height="20"></td>
<td width="260" height="20" bgcolor="#FFCCCC" style="color:#C00; text-align:center; font-weight: bold; font-size: 12px;">Please Try Again !!!</td>
</tr>
<tr>
<td width="40" height="3"></td>
<td width="260" height="3" bgcolor="#FFCCCC"></td>
</tr>
</table>
<!--InvalidUser-->
<?php }?>
</form>
</td>
</tr>
</table>
</td>
<!--BodyMenuLeft-->
<!--BodyMenuRight-->
<td width="828" align="center" valign="top">
<table width="818" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#999999">
<td height="23" colspan="3" align="center"><strong style="font-size: 14px; color: #FFF;">Student Session</strong></td>
</tr>
<tr>
<td height="32" colspan="3"></td>
</tr>
<tr bgcolor="#D6F5F5">
<td width="37" rowspan="3"></td>
<td width="744" height="6"></td>
<td width="37" rowspan="3"></td>
</tr>
<tr align="center" bgcolor="#D6F5F5" >
<td width="744"><p class="style32" align="left"><span style="color: #000; font-weight: bold; font-size: 12px;font-weight: bold; color: #004080;">Welcome to Mentor Mentee System - Student Session</span></span>.</p>
<p style="font-size: 12px; text-align: justify; font-weight: normal; color: #004080;">In this session, student's can fully access their own personal information and make necessary amendments when needed.</p>
<p style="font-size: 12px; text-align: justify; font-weight: normal;color: #004080;">At the same time, student's can view their academic information and academic progress along with a bar graph for each academic session that they have completed thus far.</p></td>
</tr>
<tr bgcolor="#D6F5F5">
<td width="744" height="6"></td>
</tr>
<tr>
<td height="32" colspan="3"></td>
</tr>
</table>
</td>
<!--BodyMenuRight-->
</tr>
<!--BodyMenuIn-->
</table>
</td>
</tr>
<!--BodyMenuOut-->
</table>
<!-- BodyFrame -->
<!-- BottomBorder -->
<table width="1250" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#999999">
<td width="1250" height="23"></td>
</tr>
<tr bgcolor="#408080">
<td width="1250" height="23"></td>
</tr>
<tr>
<td width="1250" height="6"></td>
</tr>
<tr>
<td width="1250" height="500" align="center" valign="top" style="font-size: 10px;">
<strong style="font-style: italic; color: #004080; font-weight: bold;">Faculty of Engineering Mentor Mentee</strong>
<strong><a href="login_admin.php" style="font-style: italic; color:#004080; font-weight: bold;">System</a></strong>
<strong style="font-style: italic; color: #004080; font-weight: bold;"> @ Copyright 2011</strong><br />
<strong style="font-style: italic; color: #004080; font-weight: bold;">Designed by Nor Fadzillah Hana Sabtu</strong><br />
<strong style="font-style: italic; color: #004080; font-weight: bold;">Revised by Dr Mohd Saufee Muhammad</strong></td>
</tr>
</table>
<!-- BottomBorder -->
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprypassword1 = new Spry.Widget.ValidationPassword("sprypassword1");
//-->
</script>
</body>
</html>