[Tfug] dynamic website help
Thomas Tarbet
snowboarder_tom at yahoo.com
Tue Apr 7 09:07:55 MST 2009
>The problem that I'm running into is that as far as I can tell, there
>is no way of passing information, i.e. parameters to a script if it's
>called from a link, as opposed to a form. If I could do this, this
>would be a very simple page.
>Any suggestions? It would be really awesome if the above statement
>about scripts, links and parameters were wrong. A google search didn't
>help. I thought Smarty might be a solution too, I think it's bound by
>the anchor/link limitation as well.
Yes, the above statement is wrong.
You can send parameters with links. Here is how an example of reading the parameters in PHP and setting a link with parameters:
<?php
if (isset($_GET['x'])) {
$x = $_GET['x'];
$x = $x + 1;
} else {
$x = 1;
}
?>
<p>The value of x is <?php echo $x ?></p>
<a href="?x=<?php echo $x ?>>Add one</a>
Use the $_GET and set your URL with the parameters using the form of http://blah.blah.com/page.php?var1=1&var2=2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tfug.org/pipermail/tfug_tfug.org/attachments/20090407/4960e875/attachment-0002.html>
More information about the tfug
mailing list