PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi,
Just a quick question: How do I have a link (a simple "a href" deal) that carries on variables? More speicifically, my problem arises when I want my HTML link to load the page again and goto an isset thing in the PHP. Here is currently what I have, which doesn't work:
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
ok, so now I have:
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
<?php
$test = 'Click here to check if we used GET';
$back = '';
if ( isset($_GET['test']) )
{
$test = 'Yep, we used get!';
$back = '<a href="' . $_SERVER['SCRIPT_FILENAME'] . '">Go back to the original</a>';
}
echo '<a href="?test=1">' . $test . '</a>';
echo "\n<br />\n";
echo $back;
?>