# Yahoo Hosting Problems with PHP

**URL:** <https://forum.kirupa.com/t/yahoo-hosting-problems-with-php/300629>\
**Category:** programming\
**Created:** [November 24, 2009, 10:00pm UTC](https://forum.kirupa.com/t/yahoo-hosting-problems-with-php/300629 "2009-11-24T22:00:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdoany](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jdoany](https://forum.kirupa.com/u/jdoany)\
**Post date:** [November 24, 2009, 10:00pm UTC](https://forum.kirupa.com/t/yahoo-hosting-problems-with-php/300629/1 "2009-11-24T22:00:58Z")

</div>

Hi there. If anyone is willing to point me in the right direction on this…it would be amazing.

Here’s the deal…I’ve got a flash site I built, and I included a contact form, and an RSS reader. They both pull from two different php files.

They worked fine on two different testing servers…but when I transferred to Yahoo hosting…they no longer work. My assumption is because there are particular functions in the PHP file that Yahoo does not allow.

Here is the PHP for the RSS Reader:

\<?php  
//php 4 version  
$headingColor = “ffffff”;// This colour is used for the item headings, preloader colour and feed icon colour.  
$hoverColor = “ffffff”; // This is the colour when you hover on links  
$defaultColor = “ffffff”; // This is the colour for other text  
$dateColor = “ffffff”; // This is the colour for the date  
// Return the colours to the swf  
echo “&headingColor=”.$headingColor;  
echo “&hoverColor=”.$hoverColor;  
echo “&defaultColor=”.$defaultColor;  
echo “&dateColor=”.$dateColor;  
// Link to RSS feed. Change this to the full location of your feed.  
$feedUrl = “[xxxxx.wordpress.com/?feed=rss](http://xxxxx.wordpress.com/?feed=rss)”;  
// Return the url of the feed to the swf  
echo “&feedUrl=”.$feedUrl;  
// Date Format  
$dateFormat = ‘jS F y’;  
// This loads the entire XML feed  
$rssstring = file\_get\_contents($feedUrl);  
// Return the title of the feed  
preg\_match\_all("#\<title\>(._?)\</title\>#s",$rssstring,$mainTitle);  
//$mainTitle = “Your Title Here”; // Use this line instead of the line above if you want to set a different title than the RSS title  
echo “&mainTitle=”.$mainTitle[1][0];  
// Parse each item in the RSS feed  
preg\_match\_all("#\<item\>(._?)\</item\>#s",$rssstring,$items);  
$n=count($items[0]);  
// Return the total number of items  
echo “&totalItems=”.$n;  
for($i=0;$i\<$n;$i++)  
{  
$rsstemp= $items[0][$i];  
preg\_match\_all("#\<title\>(._?)\</title\>#s",$rsstemp,$titles);  
$title= $titles[1][0];  
preg\_match\_all("#\<link\>(._?)\</link\>#s",$rsstemp,$links);  
$link= $links[1][0];  
preg\_match\_all("#\<description\>(.\*?)\</description\>#s",$rsstemp,$descriptions);  
$description= $descriptions[1][0];  
$description = str\_replace("\<![CDATA[", “”, $description);  
$description = str\_replace("]]\>", “”, $description);  
// Strip html tags. Use the line below if you want to strip the html tags (including images) from your description.  
//$description = strip\_tags($description);

preg\_match\_all("#\<pubDate\>(.\*?)\</pubDate\>#s",$rsstemp,$pubDates);  
$pubDate= $pubDates[1][0];

// Replace special symbols &  
$title = str\_replace("&", “%26”, $title);  
$link = str\_replace("&", “%26”, $link);  
$description = str\_replace("&", “%26”, $description);  
// Format the time  
$pubDate = strtotime($pubDate);  
$pubDate = date($dateFormat, $pubDate);

// Return the content  
$p = $i+1;  
echo “&title$p=”.$title;  
echo “&description$p=”.$description;  
echo “&link$p=”.$link;  
echo “&pubDate$p=”.$pubDate;  
}  
?\>

I’m fairly certain that the issue is the get\_file\_contents function. Perhaps there is a way to rewrite this code to make it work on Yahoo hosting.

Here is the php for the contact form:

\<?  
$contact\_name = $\_POST[‘name’];  
$contact\_email = $\_POST[‘email’];  
$contact\_subject = $\_POST[‘subject’];  
$contact\_message = $\_POST[‘message’];  
if( $contact\_name == true )  
{  
$sender = $contact\_email;  
$receiver = “[name@domain.com](mailto:name@domain.com)”;  
$client\_ip = $\_SERVER[‘REMOTE\_ADDR’];  
$email\_body = “Name: $contact\_name  
Email: $sender  
Subject: $contact\_subject  
Message: $contact\_message  
IP: $client\_ip”;  
$extra = "From: $sender  
" . "Reply-To: $sender  
" . “X-Mailer: PHP/” . phpversion();  
if( mail( $receiver, “Flash Contact Form - $subject”, $email\_body, $extra ) )  
{  
echo “success=yes”;  
}  
else  
{  
echo “success=no”;  
}  
}  
?\>

If anyone at all can help me…or at least give me a hint on how to make this work it would be awesome…otherwise I’ll have to find a whole new contact form and rss reader…and there is no guarantee that those will work either.
