This is a discussion on How to change relative urls to absolute?! - PHP ; I am using PHP Simple HTML DOM Parser to get the picthumbs from a daily chart from another website on mine. The problem is their urls are relative and when a user clicks on the pix in my site it ...
I am using PHP Simple HTML DOM Parser to get the picthumbs from a daily chart from another website on mine.
The problem is their urls are relative and when a user clicks on the pix in my site it leads him to the url of my site+the rest of the url, instead of the url of their site+the rest of the url.
Here is the code I use:
<?php
require_once('simple_html_dom.php');
require_once('url_to_absolute.php');
$html = file_get_html($url);
foreach($html->find('table td[class=clipThumb]') as $element) {
echo $element ;
}
?>
And here is the code of their thumbs:
<td class="clipThumb">
<a href="/play:agjhb0b4d">
<img id="picview" width="100" height="100" border="0" src="http://www.website.com/agjhb0b4d.jpg" title="Bla bla bla"/>
</a>
</td>
1.How to change the url so it points to their url+rest of href
2.How to make it open in another tab window of the browser when clicked on my site
Thanks in advance for ur time!!!