In a PHP page, I need to open a URL when a button or link is clicked. But the URL that I open needs a variable.
Background - when the user presses the "proceed" button, a page that depends on the price will open. Different prices, different page.
I hope I'm not too obtuse, but here's a text example.
I have an order confirmation page that includes the price in the URL:
www.xys.com/confirm?price=100
The confirm page is where the user gets to proceed or stop. Two buttons. The price determines which page we open when the user clicks on "proceed".
So, if the price is $100
, the user sees page_100.php
. If the price is $200
the user sees page_200.php
The problem I am running into is that $price does not translate into a value
<?php
$price = $_GET['price'];
<input type="button" onclick="window.location.href='selector.php?$price';return false;" name="" value="Proceed">
?>
What am I missing? Thanks.