Reputation: 23
The following snippet currently works, however having difficulties replacing the numeric value for group_type with $_GET['group_type'] which has been passed from previous page which I require to be passed onto sales.php.
<select name="group_id" onclick="javascript:document.location.href='sales.php?group_type=2&group_id='+this.value;"
Thanks
Upvotes: 0
Views: 229
Reputation: 456
Try:
<select name="group_id" onclick="javascript:document.location.href='sales.php?group_type=<?=$_GET['group_type']?>&group_id='+this.value;">
Upvotes: 1
Reputation: 573
You need to inject it in the php code
<select name="group_id" onclick="javascript:document.location.href='sales.php?group_type=<?php echo $_GET['group_type'] ?>'&group_id='+this.value;"
Upvotes: 0