Page 1 of 1

mailto http link problem

PostPosted: Mon Apr 27, 2009 4:10 pm
by jbrnz
I have setup a delegate class for a table in my DB. I have a mailto function that works correctly, however the code for the website field takes me to my URL+www.thesitereferenced.com

(e.g. http://mydomain/myapp/www.thesitereferenced.com.)

Here is the code

function website__renderCell( &$record ){
return $record->strval('website').' (<a href="'.$record->strval('website').'">visit</a>)';

How can I make it so that it only references the site in the field, and does not add my url to the front?

Note: the websites in my DB do not have the http:// in front of the address. Could this be the problem?

Thanks

http link fix - simple mistake

PostPosted: Mon Apr 27, 2009 8:21 pm
by jbrnz
I hope I don't start filling the board with too many dumb mistakes like this. Just in case anyone else can't get their links to work solution below.

In my tables delegate class folder (mytable.php) I did not enter the "http://' after the quote which added my site url to the front of the record:

Code was:
function myfield__renderCell( &$record ){
return $record->strval('myfield').' (<a href="'.$record->strval('myfield').'">visit</a>)';

Changed to:

function myfield__renderCell( &$record ){
return $record->strval('myfield').' (<a href="http://'.$record->strval('myfield').'">visit</a>)';[/b]