Excuse the modules-related question, but all the 'smart people' seem to be on this list now :')
I'm working on a module that needs to redirect the user to another web site. Yahoo maps, to be specific. The url contains an address, and yahoo maps is choking on "funny" characters in the address. It's actually works OK if things like spaces and "#"'s are converted to entities, so I'm trying to do that but it's not working.
I have:
$addrentities =htmlentities($address);
but the characters in $addrentities are not converted.
Anyone know why? Am I using this function wrong or should I be using a different function?
"Rob Brandt" <rbrandt-MM+Gfc+YChXR7s880joybQ@public.gmane.org> wrote in message news:mailman.1034036881.15843.xaraya_public-dev-n5IRV0TL0hwRxVAL8JNkP+OyGI2DFzLe@public.gmane.org> Excuse the modules-related question, but all the 'smart people' seem> to be on this list now :')>
I'm working on a module that needs to redirect the user to another> web site. Yahoo maps, to be specific. The url contains an address,> and yahoo maps is choking on "funny" characters in the address. It's> actually works OK if things like spaces and "#"'s are converted to> entities, so I'm trying to do that but it's not working.>
Just as a cursory look at your question (perhaps this will work, perhaps it won't, not sure what the output you are getting is;) you may want to use htmlspecialcharacters instead that htmlentities.
If that doesn't work, could you include the output as an example so we can see what it is dieing on. I'm not as smart as some (most) of the others, and I kinda need to play with the outputs from time to time.
Actually, htmlspecialcharacters was what I thought I needed at first, but the php docs says that it only converts quotes, ampersands and less than greater than to entities. It's for handling html tags for the most part. htmlentities is supposed to convert all non alphanumeric characters.
OK, here's the address I'm using. It's my address, so you all are going to have to promise not to ring my doorbell at night :')
The string I'm starting out with is "1220 Coast Village Road #206". When I do
$addrentities = htmlentities("1220 Coast Village Road #206");
and then look at the value of $addrentities it is still "1220 Coast Village Road #206". For this particular address, at the bare minimum Yahoo needs the # converted to an entity. Converting all of the spaces will make it more reliable. Converting any non alphanumeric will be best, since end users will tend to put all kinds of stuff into addresses. Yahoo seems to handle all the garbage in an address pretty well if they're entities.
"Rob Brandt" <rbrandt-MM+Gfc+YChXR7s880joybQ@public.gmane.org> wrote in message>news:mailman.1034036881.15843.xaraya_public-dev-n5IRV0TL0hwRxVAL8JNkP+OyGI2DFzLe@public.gmane.org>> Excuse the modules-related question, but all the 'smart people' seem>> to be on this list now :')>>
I'm working on a module that needs to redirect the user to another>> web site. Yahoo maps, to be specific. The url contains an address,>> and yahoo maps is choking on "funny" characters in the address. It's>> actually works OK if things like spaces and "#"'s are converted to>> entities, so I'm trying to do that but it's not working.>>
Just as a cursory look at your question (perhaps this will work, perhaps it>won't, not sure what the output you are getting is;) you may want to use>htmlspecialcharacters instead that htmlentities.>
If that doesn't work, could you include the output as an example so we can>see what it is dieing on. I'm not as smart as some (most) of the others,>and I kinda need to play with the outputs from time to time.
"Rob Brandt" <rbrandt-MM+Gfc+YChXR7s880joybQ@public.gmane.org> wrote in message news:mailman.1034038981.17438.xaraya_public-dev-n5IRV0TL0hwRxVAL8JNkP+OyGI2DFzLe@public.gmane.org> Actually, htmlspecialcharacters was what I thought I needed at first,> but the php docs says that it only converts quotes, ampersands and> less than greater than to entities. It's for handling html tags for> the most part. htmlentities is supposed to convert all non> alphanumeric characters.
Because the yahoo string is replacing the # with %23 (not sure if that is an official entity or not). That should convert the # sign as well as the entities. I have never tried to replace a space before, but it might be worth a shot to try to replace it with a + sign as well.
My syntax might be off a bit, because my skills are getting rusty, but it should be able to get you started I would think.
Have you tried the urlencode function? It will do half the job for you.
-- Jason
----- Original Message ----- From: "Rob Brandt" <rbrandt-MM+Gfc+YChXR7s880joybQ@public.gmane.org> To: <xaraya_public-dev-n5IRV0TL0hwRxVAL8JNkPw@public.gmane.org> Sent: Tuesday, October 08, 2002 2:01 AM Subject: Re: [Xaraya_public-dev] htmlentities problem
Actually, htmlspecialcharacters was what I thought I needed at first,> but the php docs says that it only converts quotes, ampersands and> less than greater than to entities. It's for handling html tags for> the most part. htmlentities is supposed to convert all non> alphanumeric characters.>
OK, here's the address I'm using. It's my address, so you all are> going to have to promise not to ring my doorbell at night :')>
The string I'm starting out with is "1220 Coast Village Road #206". When
I do>
$addrentities = htmlentities("1220 Coast Village Road #206");>
and then look at the value of $addrentities it is still "1220 Coast> Village Road #206". For this particular address, at the bare minimum> Yahoo needs the # converted to an entity. Converting all of the> spaces will make it more reliable. Converting any non alphanumeric> will be best, since end users will tend to put all kinds of stuff> into addresses. Yahoo seems to handle all the garbage in an address> pretty well if they're entities.>
"Rob Brandt" <rbrandt-MM+Gfc+YChXR7s880joybQ@public.gmane.org> wrote in message> >news:mailman.1034036881.15843.xaraya_public-dev-n5IRV0TL0hwRxVAL8JNkP+OyGI2DFzLe@public.gmane.org> >> Excuse the modules-related question, but all the 'smart people' seem> >> to be on this list now :')> >>
I'm working on a module that needs to redirect the user to another> >> web site. Yahoo maps, to be specific. The url contains an address,> >> and yahoo maps is choking on "funny" characters in the address. It's> >> actually works OK if things like spaces and "#"'s are converted to> >> entities, so I'm trying to do that but it's not working.> >>
Just as a cursory look at your question (perhaps this will work, perhaps
won't, not sure what the output you are getting is;) you may want to use> >htmlspecialcharacters instead that htmlentities.> >
If that doesn't work, could you include the output as an example so we
see what it is dieing on. I'm not as smart as some (most) of the others,> >and I kinda need to play with the outputs from time to time.> _______________________________________________> Xaraya_public-dev mailing list> Xaraya_public-dev-n5IRV0TL0hwRxVAL8JNkPw@public.gmane.org> http://lists.xaraya.com/mailman/listinfo/xaraya_public-dev>
"Jason Judge" <jason.judge-LWM1r6xbH6sqdlJmJB21zg@public.gmane.org> wrote in message news:mailman.1034040062.18301.xaraya_public-dev-n5IRV0TL0hwRxVAL8JNkP+OyGI2DFzLe@public.gmane.org> Have you tried the urlencode function? It will do half the job for you.
heh, that is probably why I have never tried converting a space before;) I need to go back to drinking. At least I would have an excuse when I am dense;)
In article <antc2p$i2k$1-FogMEOs31dotat4ziPANHlKoq+OfwspIAL8bYrjMMd8@public.gmane.org>, "J. Cox" <admin@dinerminor.com> wrote:>...>$addrentities =str_replace("#", "%23", $addrentities);>
Because the yahoo string is replacing the # with %23 (not sure if that is an>official entity or not). That should convert the # sign as well as the>entities. I have never tried to replace a space before, but it might be>worth a shot to try to replace it with a + sign as well.
That's not htmlentities you're showing, it's URL encoding - totally different animals, living in a different place.
So if that's what Yahoo needs, you should use urlencode(...) or rawurlencode(...).
That's what I was looking for! Thanks, it works. Even though it doesn't convert the # sign, once all the spaces are +'s the browser converted the # so that it would work. I'll test it with different browsers tomorrow to make sure it's reliable.
Have you tried the urlencode function? It will do half the job for you.>
-- Jason>
----- Original Message ----->From: "Rob Brandt" <rbrandt-MM+Gfc+YChXR7s880joybQ@public.gmane.org>>To: <xaraya_public-dev-n5IRV0TL0hwRxVAL8JNkPw@public.gmane.org>>Sent: Tuesday, October 08, 2002 2:01 AM>Subject: Re: [Xaraya_public-dev] htmlentities problem>
Actually, htmlspecialcharacters was what I thought I needed at first,>> but the php docs says that it only converts quotes, ampersands and>> less than greater than to entities. It's for handling html tags for>> the most part. htmlentities is supposed to convert all non>> alphanumeric characters.>>
OK, here's the address I'm using. It's my address, so you all are>> going to have to promise not to ring my doorbell at night :')>>
The string I'm starting out with is "1220 Coast Village Road #206". When>I do>>
$addrentities = htmlentities("1220 Coast Village Road #206");>>
and then look at the value of $addrentities it is still "1220 Coast>> Village Road #206". For this particular address, at the bare minimum>> Yahoo needs the # converted to an entity. Converting all of the>> spaces will make it more reliable. Converting any non alphanumeric>> will be best, since end users will tend to put all kinds of stuff>> into addresses. Yahoo seems to handle all the garbage in an address>> pretty well if they're entities.>>
"Rob Brandt" <rbrandt-MM+Gfc+YChXR7s880joybQ@public.gmane.org> wrote in message>> >news:mailman.1034036881.15843.xaraya_public-dev-n5IRV0TL0hwRxVAL8JNkP+OyGI2DFzLe@public.gmane.org>> >> Excuse the modules-related question, but all the 'smart people' seem>> >> to be on this list now :')>> >>
I'm working on a module that needs to redirect the user to another>> >> web site. Yahoo maps, to be specific. The url contains an address,>> >> and yahoo maps is choking on "funny" characters in the address. It's>> >> actually works OK if things like spaces and "#"'s are converted to>> >> entities, so I'm trying to do that but it's not working.>> >>
Just as a cursory look at your question (perhaps this will work, perhaps>it>> >won't, not sure what the output you are getting is;) you may want to use>> >htmlspecialcharacters instead that htmlentities.>> >
If that doesn't work, could you include the output as an example so we>can>> >see what it is dieing on. I'm not as smart as some (most) of the others,>> >and I kinda need to play with the outputs from time to time.>> _______________________________________________>> Xaraya_public-dev mailing list>> Xaraya_public-dev-n5IRV0TL0hwRxVAL8JNkPw@public.gmane.org>>http://lists.xaraya.com/mailman/listinfo/xaraya_public-dev> >
S11223J2 Currently, Timberland is one of the most famous Timberland Classic brands. Throughout the 1990s, the popularity of the Timberland Kids Boot reached an important point. Also, in that time, the company added more mens Timberland 6 Inch products and lines to its catalog. Now, the prestige as a Timberland custom boots brand with excellent products is unquestionable. In preparation for the upcoming cold seasons, the company has launched its collection called Timberland Women's Boots, which is already available at the Timberland stores. http://www.timberlander.com/products_all.html
If you would like to report an abuse of our service, such as a spam message, please . Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .