| Current Path : /home/bolconlineco/www/coordinator/ajax/ |
| Current File : /home/bolconlineco/www/coordinator/ajax/validation.php |
<?php
include('../../includes/connection/func.inc.php');
//validate student id from db, tbl name student
if(isset($_POST['stuId']))
{
$stuId = $_POST['stuId'];
if(empty($stuId))
{
exit;
}
$sql = mysql_query("select count(SId) from student where rollno = '$stuId'");
$result = mysql_fetch_array($sql);
if($result['count(SId)'] == 0)
{
$str = '<div class="alert alert-success" style="padding: 8px 15px 11px 15px; margin: 0;">
<strong><span class="glyphicon glyphicon-ok"></span></strong>
</div>';
}
else
{
$str = '<div class="alert alert-danger" style="padding: 8px 15px 11px 15px; margin: 0;">
<strong><span class="glyphicon glyphicon-remove"></span></strong>
</div>';
}
echo $str;
exit;
}
//validate email from db, tbl name student
if(isset($_POST['stuEmail']))
{
$email = $_POST['stuEmail'];
if(empty($email))
{
exit;
}
$sql = mysql_query("select count(SId) from student where email = '$email'");
$result = mysql_fetch_array($sql);
if($result['count(SId)'] == 0)
{
$str = '<div class="alert alert-success" style="padding: 8px 15px 11px 15px; margin: 0;">
<strong><span class="glyphicon glyphicon-ok"></span></strong>
</div>';
}
else
{
$str = '<div class="alert alert-danger" style="padding: 8px 15px 11px 15px; margin: 0;">
<strong><span class="glyphicon glyphicon-remove"></span></strong>
</div>';
}
echo $str;
exit;
}