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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:44:52+00:00 2026-05-14T18:44:52+00:00

I’m using a PHP script to read an RSS feed in my Flex 4

  • 0

I’m using a PHP script to read an RSS feed in my Flex 4 app. The script works when I put the URL of the feed in the actual script, but I can’t get it to work when I try to send the URL as a parameter from a HTTPService in Flex.

Here is the HTTPService from Flex 4 that I’m using:

<mx:HTTPService url="http://talk.6te.net/proxy.php"
          id="proxyService" method="POST" 
          result="rssResult()" fault="rssFault()">
 <mx:request>
  <url>
       http://feeds.feedburner.com/nah_right
  </url>
 </mx:request>
</mx:HTTPService>

This is the script that works:

<?php
$ch = curl_init();
$timeout = 30;
$userAgent = $_SERVER['HTTP_USER_AGENT'];

curl_setopt($ch, CURLOPT_URL, "http://feeds.feedburner.com/nah_right");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);

$response = curl_exec($ch);    

if (curl_errno($ch)) {
    echo curl_error($ch);
} else {
    curl_close($ch);
    echo $response;
}
?>

But this is what I actually want to use, but it doesn’t work (only line 6 is different):

<?php
$ch = curl_init();
$timeout = 30;
$userAgent = $_SERVER['HTTP_USER_AGENT'];

curl_setopt($ch, CURLOPT_URL, $_REQUEST['url']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);

$response = curl_exec($ch);    

if (curl_errno($ch)) {
    echo curl_error($ch);
} else {
    curl_close($ch);
    echo $response;
}
?>

Here is the request and response output of the HTTPService from the network monitor in Flash Builder 4 (using the PHP script that doesn’t work):

Request:

POST /proxy.php HTTP/1.1
Host: talk.6te.net
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Content-type: application/x-www-form-urlencoded
Content-length: 97

url=%0A%09%09%09%09%09http%3A%2F%2Ffeeds%2Efeedburner%2Ecom%2Fnah%5Fright%0A%20%20%20%20%09%09%09

Response:

HTTP/1.1 200 OK
Date: Mon, 10 May 2010 03:23:27 GMT
Server: Apache
X-Powered-By: PHP/5.2.13
Content-Length: 15
Content-Type: text/html

<url> malformed

I’ve tried putting the URL in ” ” in the HTTPService, but that didn’t do anything. Any help would be greatly appreciated!

  • 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-14T18:44:53+00:00Added an answer on May 14, 2026 at 6:44 pm

    The $_REQUEST[‘url’] value is being urlencoded as opposed to urlencoding just the querystring. Somewhere in your code and/or FLEX service is causing a “double urlencode”. Simply url decode it and you should get the value you need. Also, I noticed line feeds and tabs so you might want to trim it as well.

    <?php
    $ch = curl_init();
    $timeout = 30;
    $userAgent = $_SERVER['HTTP_USER_AGENT'];
    

    curl_setopt($ch, CURLOPT_URL, trim(urldecode($_REQUEST[‘url’])));

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
    
    $response = curl_exec($ch);    
    
    if (curl_errno($ch)) {
        echo curl_error($ch);
    } else {
        curl_close($ch);
        echo $response;
    }
    ?>
    

    That’s it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 408k
  • Answers 408k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First of all, I think you should rethink your strategy.… May 15, 2026 at 6:49 am
  • Editorial Team
    Editorial Team added an answer Actually, Facebook's way of finding thumbnails isn't so magical. It… May 15, 2026 at 6:49 am
  • Editorial Team
    Editorial Team added an answer Understanding Full Text Search in SQL Server 2005 SQL Server… May 15, 2026 at 6:49 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.