php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65975 SimpleXML strips off URL affiliate tag
Submitted: 2013-10-27 14:04 UTC Modified: 2018-06-24 04:22 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: donfelipe2009 at yahoo dot com Assigned: cmb (profile)
Status: No Feedback Package: SimpleXML related
PHP Version: 5.4.21 OS: Chrome and IE8 on Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: donfelipe2009 at yahoo dot com
New email:
PHP Version: OS:

 

 [2013-10-27 14:04 UTC] donfelipe2009 at yahoo dot com
Description:
------------
The URL to be parsed is http://www.amazon.com/rss/tag/video%20games/recent?tag=digitaundivi-20"

SimpleXML strips off the affiliate tag: ?tag=digitaundivi-20, of the $title and the hyperlinks in the CDATA. The CDATA is in the $description. Therefore, after executing the command 'echo $html;', the hyperlinks for images, 'Buy new', and 'used and new', doesn't have the tag: ?tag=digitaundivi-20

But the hyperlinks for 'Customer tags:' do have the tag: ?tag=digitaundivi-20 

Please help. I am hoping for a simple solution. The tag: ?tag=digitaundivi-20 in the URL is needed for amazon.com to know who sent the traffic. 


The Test script can be tested at http://www.compileonline.com/execute_php_online.php   

Mr. Morgan

Test script:
---------------
<?php

$html = "";
$url = "http://www.amazon.com/rss/tag/video%20games/recent?tag=digitaundivi-20";
$xml = simplexml_load_file($url);

for($i = 0; $i < 10; $i++){
    
  $title = $xml->channel->item[$i]->title;
	$link = $xml->channel->item[$i]->link;
	$description = $xml->channel->item[$i]->description;
  $pubDate = $xml->channel->item[$i]->pubDate;
	
	$html .= "<a href='$link'><h3>$title</h3></a>";
	$html .= "$description";
	$html .= "<br />$pubDate<hr />";
}
echo $html;
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-27 14:26 UTC] donfelipe2009 at yahoo dot com
The test script below was also written as stated below and tested at http://www.compileonline.com/execute_php_online.php:

<html>
<head>
<title>Online PHP Script Execution</title>
</head>
<body>
<?php
$amazontag = '?tag=digitaundivi-20';
$html = "";
$url = "http://www.amazon.com/rss/tag/video%20games/recent?tag=digitaundivi-20";
$xml = simplexml_load_file($url);

for($i = 0; $i < 10; $i++){
    
  $title = $xml->channel->item[$i]->title;
	$link = $xml->channel->item[$i]->link;
  $link .= trim($amazontag);
	$description = $xml->channel->item[$i]->description;
  $pubDate = $xml->channel->item[$i]->pubDate;
	
	$html .= "<a href='$link'><h3>$title</h3></a>";
	$html .= "$description";
	$html .= "<br />$pubDate<hr />";
}
echo $html;
?>
</body>
</html>


NOTE: It is very important that the URL of the images contain the '?tag=digitaundivi-20' because visitors to the website usually click on the images.

The following RSS feed is correctly created by BlastCasta with '?tag=digitaundivi-20'included in all the URLs: http://poshhub.com/best-selling-video-games.html
 [2018-03-29 17:51 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2018-03-29 17:51 UTC] cmb@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

Note that the amazon URI does not work anymore.
 [2018-03-29 17:51 UTC] cmb@php.net
-Type: Feature/Change Request +Type: Bug
 [2018-06-24 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 02 19:01:31 2024 UTC