I want to execute a JavaScript after update or delete operation. but the problem is the JavaScript does not show up and straight go to other page.
Here is my code:
<?php
session_start();
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("carrental", $con);
$password1 = $_POST['password1'];
$userid =$_SESSION['SESS_MEMBER_ID'];
mysql_query("UPDATE user SET password='$password1' WHERE user_id='$userid'");
echo "<script>alert('Password has been changed.')</script>";
header("location: adminProfile.php");
mysql_close($con);
?>
I try to use include instead of header and it executed with a Notice. Need some advise..