Bug #65975 [Fbk->NoF]: SimpleXML strips off URL affiliate tag
| From: | php-bugs at lists dot php dot net | Date: | Sun, 24 Jun 2018 04:22:32 +0000 |
| Subject: | Bug #65975 [Fbk->NoF]: SimpleXML strips off URL affiliate tag | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215899@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65975&edit=1
ID: 65975
Updated by: php-bugs@lists.php.net
Reported by: donfelipe2009 at yahoo dot com
Summary: SimpleXML strips off URL affiliate tag
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: SimpleXML related
Operating System: Chrome and IE8 on Windows XP
PHP Version: 5.4.21
Assigned To: cmb
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2018-03-29 17:51:11] 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.
------------------------------------------------------------------------
[2013-10-27 14:26:22] 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
------------------------------------------------------------------------
[2013-10-27 14:04:32] 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;
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65975&edit=1