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 7635555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:27:23+00:00 2026-05-31T07:27:23+00:00

I have been trying for about a day now to get an xml feed

  • 0

I have been trying for about a day now to get an xml feed into my application. Not usually an issue and I have two other feeds coming into the application using the simpleXml method which I have attached below.

My issue is that this other page is an aspx page and it seems to have some sort of redirect or probably just using an aspx framework that is using a clean url.

This is the script I used for the other two data pulls that works fine.

$grb_feed_url = 'http://www.grb.uk.com/rss.php';
$grb_jobs = simplexml_load_file($grb_feed_url, 'SimpleXMLElement', LIBXML_NOCDATA);

That is great but when I try it for the url http://www.milkround.com/rss.aspx it returns nothing.

I then tried a cURL script, this one works fine for the godaddy example but return nothing for the Milkround url. Also strange is that if I remove the CURLOPT_FOLLOWLOCATION line or set it to 0 it returns with "object moved to here".

function get_data($url)
{
  $ch = curl_init();
  $timeout = 5;
  curl_setopt($ch,CURLOPT_URL,$url);
  curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  $data = curl_exec($ch);
  curl_close($ch);
  return $data;
}

$returned_content = get_data('http://www.milkround.com/rss');
print_r($returned_content);

/* example of a url that works using this script */
/* $returned_content = get_data('http://www.godaddy.com/hosting/website-builder.aspx'); */
  • 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-31T07:27:24+00:00Added an answer on May 31, 2026 at 7:27 am

    You need to include a User-Agent header in the cURL request, otherwise the site produces a 501 error:

    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/4");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying for about a day now to get this method to work.
So, I have been trying to fix this for about two months. It all
I have been trying to get this seemingly simple problem fixed for about half
I have been learning about move constructors over the last day or so, trying
I have been trying to know about multilingual site. Where in url should be
Good evening, I have been trying to wrap my head about this, below, code
Have have been trying to make a validator for my xml files. I have
I have been trying to us CALayers as sprites in an iPhone application I'm
I have been trying all afternoon to get the jQuery Sifr Plugin ( http://jquery.thewikies.com/sifr/
I am new to java and I have been testing my application all day

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.