Re: passing a variable with php_self

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux