Jump to content

Why doesn't this redirect work?


Mutley

Recommended Posts

	<script language='javascript'> 
	var name = confirm("Are you sure you wish to purchase a <?=$conMan?> <?=$conNam?>?");
	if(name==true)
	{
		window.location.href='shop.php?prod_id=<?=$prod_id?>&confirm=1';
	}
	else
	{
		window.location.href='';
	}
</script>
<?
}

if(isset($_GET['prod_id']) && $_GET['confirm']==1) {

 

The last IF statement won't pass when it redirects, I honestly can't figure out why!

Link to comment
https://forums.phpfreaks.com/topic/135206-why-doesnt-this-redirect-work/
Share on other sites

If it's true it redirects and that's it.  Nothing else will be executed.

 

But if it's true, then it should go to the URL I put in with the $_GET attributes not the empty ELSE option...?

 

I thought you said it was redirecting...

 

But when it is true, it does redirect with the prod_id and confirm variables but doesn't initiate the next IF statement.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.