pass/append variable to url
Posted 24 July 2006 - 06:53 PM
If for example I have a variable, foo, which creates a random number,how can I pass this variable to an html page and append it to a url.
An example of what I would like to achieve is:
where the user would see file.html and file.html would receive foo=145365432
I had a similar request not long ago but was unable to extrapolate from it. Thank you very much for your attention.
Posted 24 July 2006 - 06:57 PM
However, unless your server is set up to pass html files like php, i dont think you are going to be able to retrieve the variable and its contents in your html page.
However, you do it like this:
$var = $_GET['var'];
Posted 24 July 2006 - 06:58 PM
User posts form with number to get_form.php.
get_form looks for $_POST['rand'].
user just sees get_form.php. If you dont mind the number showing in the url, just have it $_GET instead of post and you wont need to post from a form, but rather file.php?foo=number
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users