A developer put together an image gallery that uses rss feeds to load image content for a client of mine. The code works fine on the developers server and my server. It is not working on the clients server. I assume it has something to do with either the php.ini file setting, or some other server settings since the code works fine on two other servers.
My server is running PHP Version 5.2.17 - Linux linhost123.prod.mesa1.secureserver.net 2.6.18-238.19.1.el5PAE #1 SMP Fri Jul 15 08:15:44 EDT 2011 i686
The clients server is running PHP Version 5.3.8 - Linux vux113 3.2.1-gentoo #1 SMP Tue Jan 17 07:30:40 EST 2012 x86_64
The following code gets the rss feed from the url bar and feeds it to the php page below.
[php]<?php
if(isset($_GET[‘gallery’]))
{
$feedUrl= $_GET[‘gallery’];
}
?>[/php]
The following parses the rss feed.
[php]
<?php error_reporting(0); ///function toi test If IE is being used function ae_detect_ie() { if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) return true; else return false; } $rss = simplexml_load_file( $feedUrl); $title = $rss->channel->title; echo ''.$title.'
'; $regx = "";$matches = array();
foreach( $rss->channel->item as $img ) {
preg_match( $regx, $img->description, $matches);
$imageZen = str_replace("img src=","",$matches[ 0 ]);
$imageSize =
$replacement="";
$final = substr($imageZen, 0, -1).$replacement;
}
// the loop that displays the image tags from the feed
foreach( $rss->channel->item as $img ) {
preg_match( $regx, $img->description, $matches );
$imageZen = str_replace("img src=","",$matches[ 0 ]);
$replacement="";
$final = substr($imageZen, 0, -1).$replacement;
//change image sizes
$finalEdit = str_replace('-3','-4', $final);
$finalEdit_small = str_replace('-3','-11', $final);
//secho ‘<img src=’.$finalEdit_small.‘width="" height="" />’;
// echo ‘
//ANd Finally we echo out the results
if (ae_detect_ie())
{
echo ‘
}
else
{
echo ‘
}
}
?>[/php]
Any help is appreciated.