View Single Post
Old 12-18-2012, 07:57 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,261
Thanks: 10
Thanked 533 Times in 527 Posts
devnull69 will become famous soon enough
You'll have to understand that your PHP code will already be finished when Javascript is running. So if you put PHP code into your Javascript conditional, it won't do anything at run time because it will already have been evaluated and executed at page creation time.

You can do the redirection with Javascript only, though
Code:
function show_confirm()
{
	
	var s= confirm("Are you sure?")
	if (s==true)
		{
			window.location.href = "sad52/enrollment.php";
		}
	
}
devnull69 is offline   Reply With Quote
Users who have thanked devnull69 for this post:
lanx2cool (12-18-2012)