You are here: Re: how to pass xhtml variable to php function.. « All PHP « IT news, forums, messages
Re: how to pass xhtml variable to php function..

Posted by  on 10/10/77 11:23

| waplink("[ Send
| ]","forward.php",array("From"=>"$(From)","To"=>"$(To)","Subject"=>"$(Subject)","F"=>$F,"U"=>$U,"P"=>$P,"msgid"=>$msgid));

use {} to expand a variable in a string...i.e. ${From}, ${To}, ${Subject}
.... in this case though, there is no need to use quotes or expand the
variables...i.e. $From, $To, $Subject should be just fine.

| function waplink($name,$href,$fields) {
| /* generates the needed link in xhtml from an array */
| $arg = "";
| foreach ($fields as $key => $value)
| $arg .= "".$key."=".$value."&";
| ?>
| <small><a href="<?=$href."?".$arg?>"><?=$name?></a>
| </small><br/>
| <?}

it's not a good idea to spew html from a function...but, that's up to you.

hth,

me

 

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

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