webmx04
04-08-2011, 07:26 PM
Hi I have a Php screen scrape script that only shows a blank page, it was working before but when we installed noahs classifieds then the problem occured. here is the code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Weather API</title>
</head>
<body>
<div id="widget-wrapper"><!-- start widget-wrapper-->
<div class="weather"><!-- start weather-->
<h2><a href="http://www.royalgazette.com/section/weather" title="More on Weather" target="_top">Current Weather</a></h2>
<?php
include('simple_html_dom.php');
include ('phpQuery.php');
// Create DOM from URL
$html = file_get_html('http://www.weather.bm/');
?>
<a href="http://www.royalgazette.com/section/weather" target="_top">
<?php
// find all span tags with class=gb1
$element = $html->find("div");
$element[66]->class = "mwraping66";
foreach($html->find('.mwraping66 img') as $e)
$doc = phpQuery::newDocumentHTML( $e ); $containers = pq('.mwraping66', $doc); foreach( $containers as $container ) { $div = pq('img', $container);
$div->eq(1)->removeAttr('style')->addClass('thumbnail')->html( pq( 'img', $div->eq(1))->removeAttr('height')->removeAttr('width')->removeAttr('alt') );
$div->eq(0)->removeAttr('style')->addClass('day')->html( pq( 'u', $div->eq(0) )->html() ); $div->eq(2)->removeAttr('style')->addClass('description'); } print $doc;
?>
</a>
<span class="condition">
<a href="http://www.royalgazette.com/section/weather" title="More on Weather" target="_top"><H4>
<?php
$element = $html->find("div");
$element[31]->class = "mwraping31";
foreach($html->find('.mwraping31') as $e)
echo $e->plaintext;
?></H4><p>
<?php
$element = $html->find("div");
$element[28]->class = "mwraping28";
foreach($html->find('.mwraping28') as $e)
echo $e->plaintext;
?></p></a></span>
</div><!-- end weather-->
</div> <!-- end widget-wrapper-->
</body>
</html>
The weird part is it's working on my other hosting provider
here is my site
http://www.rgbdahosting.com/weather/testwiget.php
here is my other hosting which is working
http://www.j2sdesign.com/weather/testwiget.php
I am thinking that installing noahsclassifieds might have change some settings in the php but that shouldn't happen. can anyone give me an advice
it even doesn't work on some other script example
http://komunitasweb.com/2009/09/showing-the-weather-with-php-and-google-weather-api/ I just cut and paste it and still I only get blank page. But the authors demo page is working
thanks in advance appreciate your help if you need phpinfo I can give it you
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Weather API</title>
</head>
<body>
<div id="widget-wrapper"><!-- start widget-wrapper-->
<div class="weather"><!-- start weather-->
<h2><a href="http://www.royalgazette.com/section/weather" title="More on Weather" target="_top">Current Weather</a></h2>
<?php
include('simple_html_dom.php');
include ('phpQuery.php');
// Create DOM from URL
$html = file_get_html('http://www.weather.bm/');
?>
<a href="http://www.royalgazette.com/section/weather" target="_top">
<?php
// find all span tags with class=gb1
$element = $html->find("div");
$element[66]->class = "mwraping66";
foreach($html->find('.mwraping66 img') as $e)
$doc = phpQuery::newDocumentHTML( $e ); $containers = pq('.mwraping66', $doc); foreach( $containers as $container ) { $div = pq('img', $container);
$div->eq(1)->removeAttr('style')->addClass('thumbnail')->html( pq( 'img', $div->eq(1))->removeAttr('height')->removeAttr('width')->removeAttr('alt') );
$div->eq(0)->removeAttr('style')->addClass('day')->html( pq( 'u', $div->eq(0) )->html() ); $div->eq(2)->removeAttr('style')->addClass('description'); } print $doc;
?>
</a>
<span class="condition">
<a href="http://www.royalgazette.com/section/weather" title="More on Weather" target="_top"><H4>
<?php
$element = $html->find("div");
$element[31]->class = "mwraping31";
foreach($html->find('.mwraping31') as $e)
echo $e->plaintext;
?></H4><p>
<?php
$element = $html->find("div");
$element[28]->class = "mwraping28";
foreach($html->find('.mwraping28') as $e)
echo $e->plaintext;
?></p></a></span>
</div><!-- end weather-->
</div> <!-- end widget-wrapper-->
</body>
</html>
The weird part is it's working on my other hosting provider
here is my site
http://www.rgbdahosting.com/weather/testwiget.php
here is my other hosting which is working
http://www.j2sdesign.com/weather/testwiget.php
I am thinking that installing noahsclassifieds might have change some settings in the php but that shouldn't happen. can anyone give me an advice
it even doesn't work on some other script example
http://komunitasweb.com/2009/09/showing-the-weather-with-php-and-google-weather-api/ I just cut and paste it and still I only get blank page. But the authors demo page is working
thanks in advance appreciate your help if you need phpinfo I can give it you