Reply to Re: [PHP] passing a variable with php_self

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация