Posted by Torgny Bjers on 09/27/05 16:17
Ross wrote:
> can someone show me the right way to do the following...
>
> <a href="<?=$PHP_SELF?action=bigger; ?>">
>
> I want to pass a variable to a self submitting link.
Easiest way to do that is to use sprintf() or printf():
<?php
$link_title = "click my self-referring link";
printf('a href="%s?action=bigger">%s</a>', $_SERVER['PHP_SELF'],
$link_title);
?>
Or, like you did with inline code in the HTML:
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?action=bigger">click my
self-referring link</a>
Warm Regards,
Torgny
[Back to original message]
|