Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6340733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:53:31+00:00 2026-05-24T19:53:31+00:00

Try this sample code I threw together to illustrate a point: <?php $url =

  • 0

Try this sample code I threw together to illustrate a point:

<?php 
$url = "http://www.amazon.com/gp/offer-listing/B003WSNV4E/";
$html = file_get_contents($url);
echo($html);
?>

The amazon homepage works fine using this method (it is echoed in the browser), but this page just doesn’t output anything. Is there a reason for this, and how can I fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:53:32+00:00Added an answer on May 24, 2026 at 7:53 pm

    I think your problem is that you’re misunderstanding your own code.

    You made this comment on the question (emphasis mine):

    I’ve never used those utilities before, so maybe I’m doing it wrong but it only seems to be downloading this page: https://www.amazon.com/gp/offer-listing/B003WSNV4E/ref=dp_olp_new?ie=UTF8&condition=new

    This implies to me that an Amazon page is appearing in your browser when you run this code. This is entirely expected.

    When you try to download https://rads.stackoverflow.com/amzn/click/B003WSNV4E, you’re being redirected to https://www.amazon.com/gp/offer-listing/B003WSNV4E/ref=dp_olp_new?ie=UTF8&condition=new which is the intent of StackOverflow’s RADS system.

    What happens from there is your code is loading the raw HTML into your $html variable and dumping it straight to the browser. Because you’re passing raw HTML to the browser, the browser is interpreting it as such, and it tries (and succeeds) in rendering the page.

    If you just want to see the code, but not render it, then you need to convert it into html entities first:

    echo htmlentities($html);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run the sample code from this Sun tutorial: http://download.oracle.com/javase/6/docs/technotes/guides/rmi/hello/hello-world.html I've copied
please try this link for getting my code. its working in all browsers not
When I try this code: a, b, c = (1, 2, 3) def test():
When I try this code: class MyStuff: def average(a, b, c): # Get the
I would like to try this code: public struct Direction { private int _azimuth;
When I try this code: dict_a = dict_b = dict_c = {} dict_c['hello'] =
In this code sample, is there any way to continue on the outer loop
If I try to implement this simple-as-possible example: Update Content with AJAXRefreshRequest it does
I will try to keep this as simple as possible. I have a rather
I try this command to upload a file (standard.xml) into table book the file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.