I have had a problem with some scripts I wrote (Screenscrapers) that worked great in PHP4, but stopped working the minute I upgraded to PHP5.
I can change all of my filenames to have the .PHP4 extension and this solves the problem, but since this encompasses a number of sites, internal links and hundreds of files, this is not my first choice solution.
Here is the scraper, what it does, is it takes items from the zazzle Results Page by category, strips out the formatting, adds my affiliate ID and then I can present these items on my page.
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test of scrape</title>
$rf_id="238219236805025733";
// Regular expression to parse "&rf=" and the $rf_id into the existing link
$page=preg_replace("/(.*?)(href\s*=+\s*[\"\'])(.*?)([\"\'])(.*?)/is","$1$2$3?rf=$rf_id$4$5",$page);
My ideal solution would be an .htaccess file that I could put in any directory under PHP5 to make it default to php4.
I have tried this, to no avail (.htaccess):
Bookmarks