Forum Moderators: coopster
<a href="callFunction?" title=""></a>
Basically, how through a link can I refresh the page and pass the function variables.
Querystrings begin with a "?", and are made up of "name=value" pairs separated by ampersands (&).
your link will look something like this:
<a href="index.php?var1=foo&var2=bar">hello world</a>
When the page is reloaded with the querystring, your variables can be accessed in the $HTTP_GET_VARS array:
<?php
echo $HTTP_GET_VARS['var1']; // prints "foo"
echo $HTTP_GET_VARS['var2']; // prints "bar"
?>
so, if you want these values sent into a function you put this in your script:
<?php
dothis($HTTP_GET_VARS['var1'],$HTTP_GET_VARS['var2']);
function dothis($var1,$var2){
echo $var1." ".$var2;
}
?>
I hope this helps.
[edited by: jatar_k at 5:47 pm (utc) on April 14, 2004]
[edit reason] removed last comment [/edit]