Passing full outside URL through PHP

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 9, 2014   (RSS)

By nmsinc - June 9, 2014

Trying to pass the URL a URL located outside our main website with no luck. - Instead of passing http://www.someother_website.com it passes http://www.mywebsite.com/http:www.someother_website.com

Current code as follows:

<ahref="<?php echo $CURRENT_USER['calendar_url']?>"onclick="NewWindow(this.href,'mywin','1100','750','yes','center');return false"onfocus="this.blur()">

Any ideas?

Thanks - nmsinc

nmsinc

By claire - June 9, 2014 - edited: June 9, 2014

Hi nmsinc

I hope I understand what you're going for here - can you try this?

<a onclick="window.open('<?php echo $CURRENT_USER['calendar_url']; ?>','mywin','1100','750','yes','center'); return false;" onfocus="this.blur()">

Then check the output of <?php echo $CURRENT_USER['calendar_url']; ?>. If this doesn't produce a valid link (with http:// or https:// at the start) then the browser will likely read it as an internal URL and it'll come out like 'http://www.mywebsite.com/http:www.someother_website.com'.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/