Page 1 of 1

Hyperlink - prevent Field Data from being appended

Posted: Wed Apr 26, 2017 1:59 pm
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.


Re: Hyperlink - prevent Field Data from being appended

Posted: Wed Apr 26, 2017 11:26 pm
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


Re: Hyperlink - prevent Field Data from being appended

Posted: Thu Apr 27, 2017 8:20 am
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.