pozitronio85
04-04-2015, 04:48 PM
Hi guys, i want to appear a new window in web browser application with a messege. i try with echo but it can't. as same as the window alert. the code is following
<?php
session_start();
if ((!(isset($_SESSION['usertype'])))||($_SESSION['usertype']!="admintp")){
header( 'Location: ../index.php');
}
$id = $_POST['id'];
include 'catalogdbinfo.php';
//if he is captain then don't delete
$specs=mysql_query("select speciality from tblemployee where id=".$id);
$captain=mysql_query("select empid from tblroute where empid=".$id);
if((mysql_result($specs,0,'speciality')=="Captain") && (mysql_numrows($captain)>0))
echo "the employer is captain and he can not delete";
else
{
//else delete
mysql_query("delete from tblemployee where id=".$id);
echo " the employer delete";
}
mysql_close($link);
?>
<script language="javascript">
window.location="updateemp.php";
</script>
<?php
session_start();
if ((!(isset($_SESSION['usertype'])))||($_SESSION['usertype']!="admintp")){
header( 'Location: ../index.php');
}
$id = $_POST['id'];
include 'catalogdbinfo.php';
//if he is captain then don't delete
$specs=mysql_query("select speciality from tblemployee where id=".$id);
$captain=mysql_query("select empid from tblroute where empid=".$id);
if((mysql_result($specs,0,'speciality')=="Captain") && (mysql_numrows($captain)>0))
echo "the employer is captain and he can not delete";
else
{
//else delete
mysql_query("delete from tblemployee where id=".$id);
echo " the employer delete";
}
mysql_close($link);
?>
<script language="javascript">
window.location="updateemp.php";
</script>