I have a html form ith radio buttons where people select a small medium or large product.
I know that the form names become $variables in php and I know how to do if, else
and I can get it to do
<? if ($product_size == "small")
(
print ("whatever")
)
else (
print ("something else")
)
?>
And it prints correctly
But how do I get it to go to a different url for each of the form values, i.e. a different url for a small, medium and large products.
I have tried puting the urls into my original html form i.e.
<input type="hidden" name="small_url" value="http://mydomain/smallproducturl.html">
and then putting :
<?
if (product_size == "small")
(
header (location: ("$small_url")
)
I have tried looking at the sources of loads of pages for the command to send users to a url and nothing works -- please help me I'm going insane.
I also would like each user to be counted and for their customer number to be a value in the form they are redirected to
something like this in the original form perhaps.
<input type="hidden" name="customer_count" value="100000">
Then in the php form page
function (givecustomernumber)
($customer_count+1=$customer_number)
<input type="hidden" name="customer_number" value="$customer_number"
But this would give every ductomer the same number, how can I get it to change the customer_count variable everytime the page is run, so that every new customer gets the same number as the last +1 i.e the first person to select small product size gets customer number 100001 and the second gets 100002
Like I say I am a total begginer and the examples of code I have given are probably so far wrong nobody will be able to respond becuase they can't stop laughing, but I've said what i want to do and I'm hoping you can help me get there.