I am able to get javascript variable output into php variable,but i am not able to store php variable value stored from javascript variable into database its storing the whole script for eg:
<script>document.write(answer)</script>
I tried on update to redirect on registration page but it remain static on the same page.
Here is my code :
if(isset($_GET['status']))
{
if($_GET['status']=="Rejected")
{
echo("<script type='text/javascript'> var answer = prompt('Please enter'); </script>");?>
<script>var a = document.write(answer);
window.location.href = window.location.href+'#reason='+answer;</script>
<?php
if(isset($_GET['reason']))
{
$reason=$_GET['reason'];
$approve="UPDATE approveleave SET status='Rejected',rejectreason='".$reason."' WHERE id='".$id."'";
$result2=mysql_query($approve,$con);
header("location:registration.php");
}
}
}
?>
Any solution will be appreciated.
Thanks