You are here: Re: Angle brackets cause string to truncate « PHP Programming Language « IT news, forums, messages
Re: Angle brackets cause string to truncate

Posted by Gordon Burditt on 04/07/07 00:17

>I am trying to build an email address in PHP code using v5.1.2. All
>works well until I try to surround the email address with angle
>brackets.

Have you considered viewing the result in something other than HTML?
(or using the "view source" function of your browser?) I believe
the string really is there; you <dead cat> just don't see it
<dead cat> in a browser <dead cat>. When you read this, how many
dead cats are there in the previous sentence? There are three.

>Every method I try causes the email address to disappear
>completely. I have to believe that this is a common problem, but I
>can't find any answers in the PHP docs or in Google. Any insight
>would be greatly appreciated. Below are some of my failed attempts.
>
>$strAddressee = "$ContactName "."<"."$ContactEmail".">";
>(brackets and email address disappear)
>
>$strAddressee = "$ContactName <$ContactEmail>";
>(brackets and email address disappear)
>
>$strAddressee = "$ContactName \074 $ContactEmail \076";
>(works, except for unwanted spaces between the brackets and address)
>
>$strAddressee = "$ContactName \074{$ContactEmail}\076";
>(brackets and email address disappear)

If you want to output this string on a web page and *only* on a
web page, try:

$strAddressee = "$ContactName &lt;$ContactEmail&gt;";

but if you put that in mail headers it will probably screw up.

 

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

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