Hyper link question

Here is what I have in my code:

$link = "www.google.com/this_is_a_really_long_URL";
$shortLink = substr($link, 0, 20);

print ("<a href='$link' target='_blank'>$shortLink</a>");

When I save the page, and then put my mouse over the link, it’s doing this:

http://test.myWebsite.com/tools/www.google.com/this_

How do I force it to NOT add test.myWebsite.com/tools/ to the front of the URL? I’ve never seen this before.

Thank you.

put ‘http://’ on the front of $link

1 Like

Wow, I thought I already tried that, but apparently not. All is well now. Thanks feigall!

or '//' if you use http and https.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.