Hi all.
I have a PHP routine that works quite well. I currently run it from a small JavaScript file:
<script>
question = confirm("ready?");
if (question){ window.location="SendInvitations.php";
}else{
window.history.back();
}
</script>
What I"d really like to do is to put the JavaScript code in the PHP file. I've tried using echo to build the JavaScript routine, but no go. I also tired invoking the php routine using
<script type="text/javascript">
if (confirm("ready?")) {window.location = "<?echo $PHP_SELF>";
}else{
window.history.back();
}
</script>
in front of the php code. Again, no go.
This seems like it should be an easy thing to do, but I can't figure it out.
Oh ya, I really don't want to use Ajax to do this.
Any suggestions would be appreciated.