Hyperlink - prevent Field Data from being appended

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
kymh
User
Posts: 2

Hyperlink - prevent Field Data from being appended

Post by kymh »

I have a Hyperlink added to a Field Name.

The Hyperlink is as follows (GoogleEarth currently only works in Chrome):-
(google earth web address)@{$this->UrlEncode($this->LAT->CurrentValue)},{$this->UrlEncode($this->LON->CurrentValue)},0a,10588.66290449d,35y,-0h,0t,0r

If the field contains say 22L then the filed data, 22L is appended to the hyperlink when sent to the browser as follows (note last 3 characters from Field Data):-
(google earth web address)@40.64521,-73.754822,0a,10588.66290449d,35y,-0h,0t,0r22L
when I want:-
(google earth web address)@40.64521,-73.754822,0a,10588.66290449d,35y,-0h,0t,0r

Is there any way of preventing the field data from being appended to the hyperlink?

Any help greatly appreciated.


mobhar
User
Posts: 11660

Post by mobhar »

You may simply use PHP "substr_replace" function to replace text within a portion of a string. For more info: http://www.php.net/manual/en/function.s ... eplace.php


kymh
User
Posts: 2

Post by kymh »

Thanks Mobhar,

I was jumping in to testing PHPMaker trial version with too little knowledge and not enough time but since found out where I was going wrong.

Instead of Prefix:-
(google earth web address)@{$this->UrlEncode($this->LAT->CurrentValue)},{$this->UrlEncode($this->LON->CurrentValue)},0a,10588.66290449d,35y,-0h,0t,0r

I should have used Prefix and Suffix.
Prefix:-
(google earth web address)@{$this->UrlEncode($this->LAT->CurrentValue)} * LAT contained the field data being appended to the string before
Suffix:-
,{$this->UrlEncode($this->LON->CurrentValue)},0a,10588.66290449d,35y,-0h,0t,0r

Thanks for your rapid reply though.


Post Reply