Jump to content

XML & PHP


Skaidon

Recommended Posts

Okay, I'm VERY new to PHP and XML, here is what I have and what I need.

 

I have an XML file that outputs tracks from an album like this:

 

<tracks>
<track>Time Was</track>
<track>Sometime World</track>
<track>Blowin' Free</track>
<track>The King Will Come</track>
<track>Leaf And Stream</track>
<track>Warrior</track>
<track>Throw Down The Sword</track>
<track>Jail Bait (Live) (Live in Memphis)</track>
<track>The Pilgrim (Live In Memphis)</track>
<track>Phoenix (Live at Memphis)</track>
</tracks>

 

And I need to print each title, with a line break or comma-space in between each track.  I can get the track listing printed, but not separated.

 

Thanks to those that read this, I look forward to your replies.

Link to comment
Share on other sites

Right now I just have the tracks in $cdTracks, but printing this prints each one out like this:

 

Time WasTime WasSometime WorldTime WasSometime WorldBlowin' FreeTime WasSometime WorldBlowin' FreeThe King Will ComeTime WasSometime WorldBlowin' FreeThe King Will ComeLeaf And StreamTime WasSometime WorldBlowin' FreeThe King Will ComeLeaf And StreamWarriorTime WasSometime WorldBlowin' FreeThe King Will ComeLeaf And StreamWarriorThrow Down The SwordTime WasSometime WorldBlowin' FreeThe King Will ComeLeaf And StreamWarriorThrow Down The SwordJail Bait (Live) (Live in Memphis)Time WasSometime WorldBlowin' FreeThe King Will ComeLeaf And StreamWarriorThrow Down The SwordJail Bait (Live) (Live in Memphis)The Pilgrim (Live In Memphis)Time WasSometime WorldBlowin' FreeThe King Will ComeLeaf And StreamWarriorThrow Down The SwordJail Bait (Live) (Live in Memphis)The Pilgrim (Live In Memphis)Phoenix (Live at Memphis)

 

So it is basically returning each title, but starting at the beginning each time, like 112123124, etc....

 

Again, I'm really ne to PHP.

 

Thanks!

Link to comment
Share on other sites

<?php

		set_time_limit(100);

		include('includes.php');

		// get the search string passed to the page, and the page number if there is one
		$searchString = '';
		if (!empty($_GET)) {
			$searchString = $_GET['id'];
		}

		// this is the URL that needs to be requested to get the XML results
		$serviceURL = 'http://www.find-services.co.uk/cd/cdPrices.aspx?id=';
		$serviceURL .= $searchString;
		$serviceURL .= '&site=';
		$serviceURL .= getSiteToken();
		$serviceURL .= '&mode=heavy&sort=price';
		if (isSpider(getenv("HTTP_USER_AGENT"))) {
			$serviceURL .= '&cache=1';
		}

		// call the service, the returned XML is in $Page
		$Page = GetPage($serviceURL,'');

		// create an XML parser
		$parser = xml_parser_create(); 

		// declare some variables for use in parsing the XML
		$lastTag = '';

		$cdTitle = '';
		$cdPicURL = '';
		$cdRetailer = '';
		$cdRetailerID = '';
		$cdTotalPrice = '';
		$cdDeepLink = '';
		$cdReleaseDate = '';
		$cdCategory = '';
		$cdReview = '';
		$cdTracks = '';
		$cdArtist = '';
		$cdLastRetailerID = '';	// this is because the character data event handler splits data on an & character

		// set options and event handlers for the XML parser
		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true);
		xml_set_element_handler($parser, "startElement", "endElement");
		xml_set_character_data_handler($parser, "characterData");

		// parse the XML and stop if there is a problem
		if (!xml_parse($parser, $Page)) {
			die(sprintf("XML error: %s at line %d",
					xml_error_string(xml_get_error_code($parser)),
					xml_get_current_line_number($parser)));
		}


		// free up memory from this XML parser
		xml_parser_free($parser);

		// event handler for start elements in the XML
		function startElement($parser, $name, $attrs) 
		{
			global $lastTag;
			// get the tag name
			$lastTag = $name;
			switch ($name) {
				case "RETAILERS":
					echo '<table width="350" cellspacing="1" cellpadding="2">';
					break;
			}
		}

		// event handler for end elements in the XML
		function endElement($parser, $name) 
		{
			// allow access to global variables
			global $cdTitle, $cdArtist, $cdLastRetailerID, $cdPicURL, $cdReview, $cdTracks, $cdReleaseDate, $cdRetailer, $cdTotalPrice, $cdDeepLink, $cdRetailerID;
			// determine the name of the tag in the XML
			switch ($name) {
				case "IMAGEURL":
					echo '<div style="float:right;width:250px;"><div align="center"><img border="0" src="',$cdPicURL,'" alt="',$cdTitle,'" class="reflect rheight33 ropacity66" /></div><div id="lw_context_ads">Review:<br />',$cdReview,'</div></div>';
					break;
				case "TITLE":
					echo '<h1 style="margin:0px;padding:0px;" title="',$cdTitle,'">',$cdTitle,'</h1>';
					break;
				case "TRACK":
					echo '',$cdTracks,'';
					break;
				case "RELEASED":
					echo '<strong>Release date:</strong> ',$cdReleaseDate,'<br />';
					break;
				case "RETAILERS":
					echo '</table>';
					break;
				case "TOTAL":
					// display those retailers with a price
					if ($cdTotalPrice != '') {
						echo "<tr class='hovering'";
						echo '<td nowrap="nowrap" align="left"><a title="header=[Click to Buy for £',$cdTotalPrice,']body=[]fade=[on]" target="_blank" href="redirect.php?retailer=',$cdRetailerID,'&deeplink=',urlencode($cdDeepLink),'">',$cdRetailer,'</a></td>';
						echo '<td nowrap="nowrap" align="center"><a title="header=[Click to Buy for £',$cdTotalPrice,']body=[]fade=[on]" target="_blank" href="redirect.php?retailer=',$cdRetailerID,'&deeplink=',urlencode($cdDeepLink),'"><strong>£',$cdTotalPrice,'</strong></a></td>';
						echo '<td nowrap="nowrap" align="right"><a title="header=[Click to Buy for £',$cdTotalPrice,']body=[]fade=[on]" target="_blank" href="redirect.php?retailer=',$cdRetailerID,'&deeplink=',urlencode($cdDeepLink),'">Visit shop</a>';
						echo '</tr>';
					}
					$cdLastRetailerID = '';
					$cdTotalPrice = '';
					$cdRetailer = '';
					$cdDeepLink = '';
					$cdRetailerID = '';
					break;
			}			
		}

		echo '<title>',$cdTitle,' by ',$cdArtist,' - rockcrypt.com</title>';

		// event handler for the XML character data (i.e. the actual data in the XML)
		function characterData($parser, $data) 
		{
			global $lastTag, $cdTitle, $cdArtist, $cdPicURL, $cdReview, $cdTracks, $cdReleaseDate, $cdRetailer, $cdTotalPrice, $cdDeepLink, $cdRetailerID, $cdLastRetailerID;
			switch ($lastTag) {
				case "IMAGEURL":
					$cdPicURL = $data;
					break;
				case "TITLE":
					$cdTitle .= $data;
					break;
				case "REVIEW":
					$cdReview .= $data;
					break;
				case "TRACK":
					$cdTracks .= $data;
					break;
				case "RELEASED":
					$cdReleaseDate = $data;
					break;
				case "NAME":
					$cdRetailer = $data;
					break;
				case "TOTAL":
					$cdTotalPrice = $data;
					break;
				case "ARTIST":
					$cdArtist = $data;
					break;
				case "PRODUCTURL":
					if ($cdRetailerID == $cdLastRetailerID) {
						$cdDeepLink .= $data;
					} else {
						$cdDeepLink = $data;
					}
					$cdLastRetailerID = $cdRetailerID;
					break;
				case "IDENT":
					$cdRetailerID = $data;
					break;
			}
		}
		function isSpider($userAgent) {
			//if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'spider') !=== false) {
				//return 'spider';
			//}
			if (stristr($userAgent, "Googlebot")||			/* Google */
				stristr($userAgent, "Slurp")||			/* Inktomi */
				stristr($userAgent, "MSNBOT")||			/* MSN */
				stristr($userAgent, "MMCrawler")||		/* Yahoo */
				stristr($userAgent, "teoma")||			/* Teoma */
				stristr($userAgent, "ia_archiver")||		/* Alexa */
				stristr($userAgent, "Scooter")||		/* Altavista */
				stristr($userAgent, "Mercator")||		/* Altavista */
				stristr($userAgent, "FAST")||			/* AllTheWeb */
				stristr($userAgent, "MantraAgent")||		/* LookSmart */
				stristr($userAgent, "Lycos")||			/* Lycos */
				stristr($userAgent, "OmniExplorer")||		/* Omni categorizer */
				stristr($userAgent, "HenryTheMiragoRobot")||	/* Mirago */
				stristr($userAgent, "Ocelli")||			/* Ocelli */
				stristr($userAgent, "ichiro")||			/* ichiro */
				stristr($userAgent, "aipbot")||			/* aipbot */
				stristr($userAgent, "ExactSearch")||		/* ExactSearch */
				stristr($userAgent, "psbot")||			/* PicSearch */
				stristr($userAgent, "cometsearch")||		/* CometSystems */
				stristr($userAgent, "ZyBorg")			/* WISEnut */
			) return TRUE;
			return FALSE;
		}
	?>

 

Sorry, forgot that bit! :)

 

This code was mostly written by someone else, for a slightly different set of XML files, so I've been trying to edit it and came stuck on the multiple track entries....

 

Thanks

Link to comment
Share on other sites

<?php

		set_time_limit(100);

		include('includes.php');

		// get the search string passed to the page, and the page number if there is one
		$searchString = '';
		if (!empty($_GET)) {
			$searchString = $_GET['id'];
		}

		// this is the URL that needs to be requested to get the XML results
		$serviceURL = 'http://www.find-services.co.uk/cd/cdPrices.aspx?id=';
		$serviceURL .= $searchString;
		$serviceURL .= '&site=';
		$serviceURL .= getSiteToken();
		$serviceURL .= '&mode=heavy&sort=price';
		if (isSpider(getenv("HTTP_USER_AGENT"))) {
			$serviceURL .= '&cache=1';
		}

		// call the service, the returned XML is in $Page
		$Page = GetPage($serviceURL,'');

		// create an XML parser
		$parser = xml_parser_create(); 

		// declare some variables for use in parsing the XML
		$lastTag = '';

		$cdTitle = '';
		$cdPicURL = '';
		$cdRetailer = '';
		$cdRetailerID = '';
		$cdTotalPrice = '';
		$cdDeepLink = '';
		$cdReleaseDate = '';
		$cdCategory = '';
		$cdReview = '';
		$cdTracks = '';
		$cdArtist = '';
		$cdLastRetailerID = '';	// this is because the character data event handler splits data on an & character

		// set options and event handlers for the XML parser
		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true);
		xml_set_element_handler($parser, "startElement", "endElement");
		xml_set_character_data_handler($parser, "characterData");

		// parse the XML and stop if there is a problem
		if (!xml_parse($parser, $Page)) {
			die(sprintf("XML error: %s at line %d",
					xml_error_string(xml_get_error_code($parser)),
					xml_get_current_line_number($parser)));
		}


		// free up memory from this XML parser
		xml_parser_free($parser);

		// event handler for start elements in the XML
		function startElement($parser, $name, $attrs) 
		{
			global $lastTag;
			// get the tag name
			$lastTag = $name;
			switch ($name) {
				case "RETAILERS":
					echo '<table width="350" cellspacing="1" cellpadding="2">';
					break;
			}
		}

		// event handler for end elements in the XML
		function endElement($parser, $name) 
		{
			// allow access to global variables
			global $cdTitle, $cdArtist, $cdLastRetailerID, $cdPicURL, $cdReview, $cdTracks, $cdReleaseDate, $cdRetailer, $cdTotalPrice, $cdDeepLink, $cdRetailerID;
			// determine the name of the tag in the XML
			switch ($name) {
				case "IMAGEURL":
					echo '<div style="float:right;width:250px;"><div align="center"><img border="0" src="',$cdPicURL,'" alt="',$cdTitle,'" class="reflect rheight33 ropacity66" /></div><div id="lw_context_ads">Review:<br />',$cdReview,'</div></div>';
					break;
				case "TITLE":
					echo '<h1 style="margin:0px;padding:0px;" title="',$cdTitle,'">',$cdTitle,'</h1>';
					break;
				case "TRACK":
					echo '',$cdTracks,'';
					break;
				case "RELEASED":
					echo '<strong>Release date:</strong> ',$cdReleaseDate,'<br />';
					break;
				case "RETAILERS":
					echo '</table>';
					break;
				case "TOTAL":
					// display those retailers with a price
					if ($cdTotalPrice != '') {
						echo "<tr class='hovering'";
						echo '<td nowrap="nowrap" align="left"><a title="header=[Click to Buy for £',$cdTotalPrice,']body=[]fade=[on]" target="_blank" href="redirect.php?retailer=',$cdRetailerID,'&deeplink=',urlencode($cdDeepLink),'">',$cdRetailer,'</a></td>';
						echo '<td nowrap="nowrap" align="center"><a title="header=[Click to Buy for £',$cdTotalPrice,']body=[]fade=[on]" target="_blank" href="redirect.php?retailer=',$cdRetailerID,'&deeplink=',urlencode($cdDeepLink),'"><strong>£',$cdTotalPrice,'</strong></a></td>';
						echo '<td nowrap="nowrap" align="right"><a title="header=[Click to Buy for £',$cdTotalPrice,']body=[]fade=[on]" target="_blank" href="redirect.php?retailer=',$cdRetailerID,'&deeplink=',urlencode($cdDeepLink),'">Visit shop</a>';
						echo '</tr>';
					}
					$cdLastRetailerID = '';
					$cdTotalPrice = '';
					$cdRetailer = '';
					$cdDeepLink = '';
					$cdRetailerID = '';
					break;
			}			
		}

		echo '<title>',$cdTitle,' by ',$cdArtist,' - rockcrypt.com</title>';

		// event handler for the XML character data (i.e. the actual data in the XML)
		function characterData($parser, $data) 
		{
			global $lastTag, $cdTitle, $cdArtist, $cdPicURL, $cdReview, $cdTracks, $cdReleaseDate, $cdRetailer, $cdTotalPrice, $cdDeepLink, $cdRetailerID, $cdLastRetailerID;
			switch ($lastTag) {
				case "IMAGEURL":
					$cdPicURL = $data;
					break;
				case "TITLE":
					$cdTitle .= $data;
					break;
				case "REVIEW":
					$cdReview .= $data;
					break;
				case "TRACK":
					$cdTracks .= $data . "\r\n";
					break;
				case "RELEASED":
					$cdReleaseDate = $data;
					break;
				case "NAME":
					$cdRetailer = $data;
					break;
				case "TOTAL":
					$cdTotalPrice = $data;
					break;
				case "ARTIST":
					$cdArtist = $data;
					break;
				case "PRODUCTURL":
					if ($cdRetailerID == $cdLastRetailerID) {
						$cdDeepLink .= $data;
					} else {
						$cdDeepLink = $data;
					}
					$cdLastRetailerID = $cdRetailerID;
					break;
				case "IDENT":
					$cdRetailerID = $data;
					break;
			}
		}
		function isSpider($userAgent) {
			//if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'spider') !=== false) {
				//return 'spider';
			//}
			if (stristr($userAgent, "Googlebot")||			/* Google */
				stristr($userAgent, "Slurp")||			/* Inktomi */
				stristr($userAgent, "MSNBOT")||			/* MSN */
				stristr($userAgent, "MMCrawler")||		/* Yahoo */
				stristr($userAgent, "teoma")||			/* Teoma */
				stristr($userAgent, "ia_archiver")||		/* Alexa */
				stristr($userAgent, "Scooter")||		/* Altavista */
				stristr($userAgent, "Mercator")||		/* Altavista */
				stristr($userAgent, "FAST")||			/* AllTheWeb */
				stristr($userAgent, "MantraAgent")||		/* LookSmart */
				stristr($userAgent, "Lycos")||			/* Lycos */
				stristr($userAgent, "OmniExplorer")||		/* Omni categorizer */
				stristr($userAgent, "HenryTheMiragoRobot")||	/* Mirago */
				stristr($userAgent, "Ocelli")||			/* Ocelli */
				stristr($userAgent, "ichiro")||			/* ichiro */
				stristr($userAgent, "aipbot")||			/* aipbot */
				stristr($userAgent, "ExactSearch")||		/* ExactSearch */
				stristr($userAgent, "psbot")||			/* PicSearch */
				stristr($userAgent, "cometsearch")||		/* CometSystems */
				stristr($userAgent, "ZyBorg")			/* WISEnut */
			) return TRUE;
			return FALSE;
		}
	?>

 

I just added \r\n after the cdTracks data not sure if I'm understanding your problem correctly.

Link to comment
Share on other sites

Unfortunately, that didn't fix it, it still comes out all wrong.

 

What I want to display is:

 

Time Was, Sometime World, Blowin' Free, The King Will Come, Leaf And Stream, Warrior, Throw Down The Sword, Jail Bait (Live) (Live in Memphis), The Pilgrim (Live In Memphis), Phoenix (Live at Memphis).

 

(or have it seperated by blank lines, doesn't matter)

 

but what is being displayed is:

 

Time Was Time Was Sometime World Time Was Sometime World Blowin' Free Time Was Sometime World Blowin' Free The King Will Come Time Was Sometime World Blowin' Free The King Will Come Leaf And Stream Time Was Sometime World Blowin' Free The King Will Come Leaf And Stream Warrior Time Was Sometime World Blowin' Free The King Will Come Leaf And Stream Warrior Throw Down The Sword Time Was Sometime World Blowin' Free The King Will Come Leaf And Stream Warrior Throw Down The Sword Jail Bait (Live) (Live in Memphis) Time Was Sometime World Blowin' Free The King Will Come Leaf And Stream Warrior Throw Down The Sword Jail Bait (Live) (Live in Memphis) The Pilgrim (Live In Memphis) Time Was Sometime World Blowin' Free The King Will Come Leaf And Stream Warrior Throw Down The Sword Jail Bait (Live) (Live in Memphis) The Pilgrim (Live In Memphis) Phoenix (Live at Memphis)

 

Thanks!

Link to comment
Share on other sites

<?php

		set_time_limit(100);

		include('includes.php');

		// get the search string passed to the page, and the page number if there is one
		$searchString = '';
		if (!empty($_GET)) {
			$searchString = $_GET['id'];
		}

		// this is the URL that needs to be requested to get the XML results
		$serviceURL = 'http://www.find-services.co.uk/cd/cdPrices.aspx?id=';
		$serviceURL .= $searchString;
		$serviceURL .= '&site=';
		$serviceURL .= getSiteToken();
		$serviceURL .= '&mode=heavy&sort=price';
		if (isSpider(getenv("HTTP_USER_AGENT"))) {
			$serviceURL .= '&cache=1';
		}

		// call the service, the returned XML is in $Page
		$Page = GetPage($serviceURL,'');

		// create an XML parser
		$parser = xml_parser_create(); 

		// declare some variables for use in parsing the XML
		$lastTag = '';

		$cdTitle = '';
		$cdPicURL = '';
		$cdRetailer = '';
		$cdRetailerID = '';
		$cdTotalPrice = '';
		$cdDeepLink = '';
		$cdReleaseDate = '';
		$cdCategory = '';
		$cdReview = '';
		$cdTracks = '';
		$cdArtist = '';
		$cdLastRetailerID = '';	// this is because the character data event handler splits data on an & character

		// set options and event handlers for the XML parser
		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, true);
		xml_set_element_handler($parser, "startElement", "endElement");
		xml_set_character_data_handler($parser, "characterData");

		// parse the XML and stop if there is a problem
		if (!xml_parse($parser, $Page)) {
			die(sprintf("XML error: %s at line %d",
					xml_error_string(xml_get_error_code($parser)),
					xml_get_current_line_number($parser)));
		}


		// free up memory from this XML parser
		xml_parser_free($parser);

		// event handler for start elements in the XML
		function startElement($parser, $name, $attrs) 
		{
			global $lastTag;
			// get the tag name
			$lastTag = $name;
			switch ($name) {
				case "RETAILERS":
					echo '<table width="350" cellspacing="1" cellpadding="2">';
					break;
			}
		}

		// event handler for end elements in the XML
		function endElement($parser, $name) 
		{
			// allow access to global variables
			global $cdTitle, $cdArtist, $cdLastRetailerID, $cdPicURL, $cdReview, $cdTracks, $cdReleaseDate, $cdRetailer, $cdTotalPrice, $cdDeepLink, $cdRetailerID;
			// determine the name of the tag in the XML
			switch ($name) {
				case "IMAGEURL":
					echo '<div style="float:right;width:250px;"><div align="center"><img border="0" src="',$cdPicURL,'" alt="',$cdTitle,'" class="reflect rheight33 ropacity66" /></div><div id="lw_context_ads">Review:<br />',$cdReview,'</div></div>';
					break;
				case "TITLE":
					echo '<h1 style="margin:0px;padding:0px;" title="',$cdTitle,'">',$cdTitle,'</h1>';
					break;
				case "TRACK":
					echo '',$cdTracks,'';
					break;
				case "RELEASED":
					echo '<strong>Release date:</strong> ',$cdReleaseDate,'<br />';
					break;
				case "RETAILERS":
					echo '</table>';
					break;
				case "TOTAL":
					// display those retailers with a price
					if ($cdTotalPrice != '') {
						echo "<tr class='hovering'";
						echo '<td nowrap="nowrap" align="left"><a title="header=[Click to Buy for £',$cdTotalPrice,']body=[]fade=[on]" target="_blank" href="redirect.php?retailer=',$cdRetailerID,'&deeplink=',urlencode($cdDeepLink),'">',$cdRetailer,'</a></td>';
						echo '<td nowrap="nowrap" align="center"><a title="header=[Click to Buy for £',$cdTotalPrice,']body=[]fade=[on]" target="_blank" href="redirect.php?retailer=',$cdRetailerID,'&deeplink=',urlencode($cdDeepLink),'"><strong>£',$cdTotalPrice,'</strong></a></td>';
						echo '<td nowrap="nowrap" align="right"><a title="header=[Click to Buy for £',$cdTotalPrice,']body=[]fade=[on]" target="_blank" href="redirect.php?retailer=',$cdRetailerID,'&deeplink=',urlencode($cdDeepLink),'">Visit shop</a>';
						echo '</tr>';
					}
					$cdLastRetailerID = '';
					$cdTotalPrice = '';
					$cdRetailer = '';
					$cdDeepLink = '';
					$cdRetailerID = '';
					break;
			}			
		}

		echo '<title>',$cdTitle,' by ',$cdArtist,' - rockcrypt.com</title>';

		// event handler for the XML character data (i.e. the actual data in the XML)
		function characterData($parser, $data) 
		{
			global $lastTag, $cdTitle, $cdArtist, $cdPicURL, $cdReview, $cdTracks, $cdReleaseDate, $cdRetailer, $cdTotalPrice, $cdDeepLink, $cdRetailerID, $cdLastRetailerID;
			switch ($lastTag) {
				case "IMAGEURL":
					$cdPicURL = $data;
					break;
				case "TITLE":
					$cdTitle .= $data;
					break;
				case "REVIEW":
					$cdReview .= $data;
					break;
				case "TRACK":
					$cdTracks .= $data . ", ";
					break;
				case "RELEASED":
					$cdReleaseDate = $data;
					break;
				case "NAME":
					$cdRetailer = $data;
					break;
				case "TOTAL":
					$cdTotalPrice = $data;
					break;
				case "ARTIST":
					$cdArtist = $data;
					break;
				case "PRODUCTURL":
					if ($cdRetailerID == $cdLastRetailerID) {
						$cdDeepLink .= $data;
					} else {
						$cdDeepLink = $data;
					}
					$cdLastRetailerID = $cdRetailerID;
					break;
				case "IDENT":
					$cdRetailerID = $data;
					break;
			}
		}
		function isSpider($userAgent) {
			//if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'spider') !=== false) {
				//return 'spider';
			//}
			if (stristr($userAgent, "Googlebot")||			/* Google */
				stristr($userAgent, "Slurp")||			/* Inktomi */
				stristr($userAgent, "MSNBOT")||			/* MSN */
				stristr($userAgent, "MMCrawler")||		/* Yahoo */
				stristr($userAgent, "teoma")||			/* Teoma */
				stristr($userAgent, "ia_archiver")||		/* Alexa */
				stristr($userAgent, "Scooter")||		/* Altavista */
				stristr($userAgent, "Mercator")||		/* Altavista */
				stristr($userAgent, "FAST")||			/* AllTheWeb */
				stristr($userAgent, "MantraAgent")||		/* LookSmart */
				stristr($userAgent, "Lycos")||			/* Lycos */
				stristr($userAgent, "OmniExplorer")||		/* Omni categorizer */
				stristr($userAgent, "HenryTheMiragoRobot")||	/* Mirago */
				stristr($userAgent, "Ocelli")||			/* Ocelli */
				stristr($userAgent, "ichiro")||			/* ichiro */
				stristr($userAgent, "aipbot")||			/* aipbot */
				stristr($userAgent, "ExactSearch")||		/* ExactSearch */
				stristr($userAgent, "psbot")||			/* PicSearch */
				stristr($userAgent, "cometsearch")||		/* CometSystems */
				stristr($userAgent, "ZyBorg")			/* WISEnut */
			) return TRUE;
			return FALSE;
		}
	?>

 

Try that.

Link to comment
Share on other sites

Now we have it at:

 

Time Was, Time Was, Sometime World, Time Was, Sometime World, Blowin' Free, Time Was, Sometime World, Blowin' Free, The King Will Come, Time Was, Sometime World, Blowin' Free, The King Will Come, Leaf And Stream, Time Was, Sometime World, Blowin' Free, The King Will Come, Leaf And Stream, Warrior, Time Was, Sometime World, Blowin' Free, The King Will Come, Leaf And Stream, Warrior, Throw Down The Sword, Time Was, Sometime World, Blowin' Free, The King Will Come, Leaf And Stream, Warrior, Throw Down The Sword, Jail Bait (Live) (Live in Memphis), Time Was, Sometime World, Blowin' Free, The King Will Come, Leaf And Stream, Warrior, Throw Down The Sword, Jail Bait (Live) (Live in Memphis), The Pilgrim (Live In Memphis), Time Was, Sometime World, Blowin' Free, The King Will Come, Leaf And Stream, Warrior, Throw Down The Sword, Jail Bait (Live) (Live in Memphis), The Pilgrim (Live In Memphis), Phoenix (Live at Memphis),

 

It's still got multiple entries.  I can't seem to figure out how to get each title only once....

 

Thanks

Link to comment
Share on other sites

That is all the code I have, except the includes.php, which has this:

 

// function that actually calls the service and gets the response
function GetPage ($URL, $PostParams = ''){
// Set params...
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
if ($PostParams <> ''){
	curl_setopt($ch, CURLOPT_POSTFIELDS, $PostParams);
};
$Page = curl_exec($ch);
curl_close($ch);
return $Page;
};

 

As I said before, I'm really way out of my league here, I'm a designer not a programmer, lol

 

Thanks for your help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.