[LEFT]Hi
I have a php search form. this form not work.
My database name is Final_db and database table name is students_info
It’s html page source :
<html>
<head>
<title>Get Code Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
body,td,th {
font-family: Tahoma;
background-color:#bdbdbd;
}
.style1 {font-size: 12px}
-->
</style></head>
<body>
<h1 align="center" class="style1">Get form Code for Students in 2012</h1>
<div align="center" style="width:100%; background:#cdcdcd; font-size: 12; direction:rtl; padding:10px 30px 10px 30px; line-height:25px; border:1px solid #fff;">
<p>For get your student code inter your National code and birth year .</p>
<form action="search.php" method="post">
<tr>
<td>National Code : </td>
<td><input type="text" name="search" /></td>
</tr><br/>
<tr>
<td>Birth year : </td>
<td><input type="text" name="Birthday" /></td>
<br/><br/>
<input name="submit" type="submit" value=" Search " />
</tr><br/>
</form>
<p>Contact me : ...</p>
</div>
</body>
</html>
It’s PHP code:
<?php require_once('Connections/conecction.php'); ?>
<?php
$search= $_POST['search'];
$burth = $_POST['Birthday'];
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_conecction, $conecction);
mysql_query('set names utf8');
$query_Recordset1 = "SELECT * FROM `student_info` WHERE `Melcode` = '$search' AND `Birthday` = '$burth'";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $conecction) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<style type="text/css">
<!--
.style3 {font-family: Tahoma; font-size: 12px; line-height:25px; padding:0 8px 0 8px; }
ul,li {
line-height:25px;
text-align:right;
direction:rtl;
}
tr,td,th {
direction:rtl;
font-family: Tahoma;
font-size: 12px;
text-align:right;
}
p {
direction:rtl;
font-family: Tahoma;
font-size: 12px;
text-align:right;
padding-right:30px;
color:red;
}
body {
background-color:#bdbdbd;
font-family: Tahoma;
font-size: 12px;
}
a {
font-family: Tahoma;
font-size: 12px;
}
.result {
background-color:#dedede;
width:150px;
direction:rtl;
padding:0 10px 0 10px;
}
-->
</style>
<div class="center">
<div align="center">
<div align="center" dir="rtl" lang="fa">
<div align="center" class="style3"><strong>Get code form</strong></div>
</div>
<br>
<table border="0" align="center" dir="rtl">
<tr>
<td width="130px" align="right" bgcolor="#cdcdcd"><span class="style3">Name</span></td>
<td width="130px" align="right" bgcolor="#cdcdcd"><span class="style3">Family</span></td>
<td width="130px" align="right" bgcolor="#cdcdcd"><span class="style3">Father</span></td>
<td width="130px" align="right" bgcolor="#cdcdcd"><span class="style3">Birth Year</span></td>
<td width="130px" align="right" bgcolor="#cdcdcd" ><span class="style3">Id Num</span></td>
<td width="130px" align="right" bgcolor="#cdcdcd" ><span class="style3">National Code</span></td>
<td width="130px" align="right" bgcolor="#cdcdcd" ><span class="style3">Mobile</span></td>
</tr>
<?php do { ?>
<tr>
<td class="result"><span><?php echo $row_Recordset1['Name']; ?></span></td>
<td class="result"><span><?php echo $row_Recordset1['Family']; ?></span></td>
<td class="result"><span><?php echo $row_Recordset1['Father']; ?></span></td>
<td class="result"><span><?php echo $row_Recordset1['Birthday']; ?></span></div></td>
<td class="result"><span><?php echo $row_Recordset1['Shnum']; ?></span></div></td>
<td class="result"><span><?php echo $row_Recordset1['Melcode']; ?></span></div></td>
<td class="result"><span><?php echo $row_Recordset1['Mobile']; ?></span></div></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<div align="center" ><strong>
<tr>
<td>
<p>Note :
<ul>
<li>After inter to your accont, change your password.</li>
</ul>
</p>
</td>
</tr>
</strong></div>
</div>
</div>
And it’s error:
Warning: require_once(Connections/conecction.php): failed to open stream: No such file or directory in C:\\old_xampp\\htdocs\\search.php on line 1
Fatal error: require_once(): Failed opening required 'Connections/conecction.php' (include_path='.;C:\\old_xampp\\php\\PEAR') in C:\\old_xampp\\htdocs\\search.php on line 1
Please help me.
[/LEFT]