You are here: Re: [PHP] ampersands in href's « PHP « IT news, forums, messages
Re: [PHP] ampersands in href's

Posted by Rory Browne on 06/04/05 17:01

I think you have the idea. The &'s are used to seperate the various
variables. If you want to set $p to something like 'Tom & Jerry' then
personally I'd do something like:

<?php

$p = "Tom & Jerry";
$s = "Cat & Mouse";
printf("<a href='{$_SERVER['PHP_SELF']}?p=%s&s=%s", urlencode($p),
urlencode($s));

?>

On 6/4/05, Jack Jackson <jackson.linux@gmail.com> wrote:
> Hi,
>
> If I want to make a link to a URL which includes some GETs can I just do:
>
> <a href='{$_SERVER['PHP_SELF']}?p={$p}&c={$s}' ... etc etc
>
> or must I escape the ampersand somehow?
>
> TIA,
> --Jack
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

 

Navigation:

[Reply to this 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

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