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

  • Home
  • SEARCH
  • 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 4543630
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:33:29+00:00 2026-05-21T15:33:29+00:00

I came up with this twitter project in flash, and once i was done

  • 0

I came up with this twitter project in flash, and once i was done and tried to put it online i ran into a sandbox error. From what i’ve read it looks like i just need to setup a php proxy file. Which I get and understand. All the tutorials i’ve been able to find were for simple urls with no GET data being passed in the URL. For my project the GET data is dynamic so i can’t just put a set url in the php proxy and i dont understand php well enough to figure out how to get the get data into the proxy url..
so here’s what i know how to edit in Flex:
enter image description here

heres a full example api call i would need to make:

http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=brybam&?page=1

and here is a php proxy script that was reccomended online:

<?php

$post_data = $HTTP_RAW_POST_DATA;

$header[] = "Content-type: text/xml";
$header[] = "Content-length: ".strlen($post_data);

$ch = curl_init( $_GET['url'] ); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

if ( strlen($post_data)>0 ){
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}

$response = curl_exec($ch);     
$response_headers = curl_getinfo($ch);     

if (curl_errno($ch)) {
    print curl_error($ch);
} else {
    curl_close($ch);
    header( 'Content-type: ' . $response_headers['content-type']);
    print $response;
}


?>

Alright so getting started I just need to make the php script into a file something like twitter.php and just put it on my domain. Then I’m assuming in the URL box for the http service setup in Flex put and reenter it as something like this:

http://mydomain.com/twitter.php?screen_name=brybam&?page=1

SO what im asking is because my understanding of php is very limited, how exactly would I take the above script and make it capable of being passed

http://mydomain.com/twitter.php?screen_name=brybam&?page=1

with Flex and be able to take different potential arguments?

I think it may be something like

$page = $_GET['page'];
$screen_name = $_GET['screen_name'];

in the php file, but im not sure where i should be placing the variables into to make them part of the URL

im sure this is cake if you know php and it would be awesome if someone could help me out with this, thanks!

EDIT:
I tried this, but got an error (the error is posted under what i tried)

<?php
$page = $_GET['page'];
$screen_name = $_GET['screen_name'];
$url = $_GET['url'];
$post_data = $HTTP_RAW_POST_DATA;

$header[] = "Content-type: text/xml";
$header[] = "Content-length: ".strlen($post_data);

$ch = curl_init("'url'?screen_name='$screen_name'&?page='$page'"); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

if ( strlen($post_data)>0 ){
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}

$response = curl_exec($ch);     
$response_headers = curl_getinfo($ch);     

if (curl_errno($ch)) {
    print curl_error($ch);
} else {
    curl_close($ch);
    header( 'Content-type: ' . $response_headers['content-type']);
    print $response;
}


?>

error msg:

The response is not a valid XML or a JSON string.

Error on line 1 of document : The element type "meta" must be terminated by the matching end-tag "". Nested exception: The element type "meta" must be terminated by the matching end-tag "".
  • 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-21T15:33:30+00:00Added an answer on May 21, 2026 at 3:33 pm

    This Works:

    <?php
    
    $post_data = $HTTP_RAW_POST_DATA;
    
    $header[] = "Content-type: text/xml";
    $header[] = "Content-length: ".strlen($post_data);
    
    $screen_name = $_GET['screen_name'];
    $page = $_GET['page'];
    
    $url = "http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=$screen_name&page=$page";
    
    $ch = curl_init($url); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    
    if ( strlen($post_data)>0 ){
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    }
    
    $response = curl_exec($ch);     
    $response_headers = curl_getinfo($ch);     
    
    if (curl_errno($ch)) {
        print curl_error($ch);
    } else {
        curl_close($ch);
        header( 'Content-type: ' . $response_headers['content-type']);
        print $response;
    }
    ?>
    

    Although, if you are going to be calling more then just that one api call, you may want to consider building the the request string in AS, and just tacking the whole string to the end of the domain.

    IE.

    you would pass something like “1/statuses/user_timeline.xml?screen_name=brybam&?page=1” to a single parameter.

    And your php would look like this…

    $query= $_GET['query'];
    $url = "http://api.twitter.com/$query";
    

    Or even better, create your own service API that uses your own API calls specific to your application. This way you do not need to rebuild the SWF if and when the twitter API changes.

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

Sidebar

Related Questions

I came across this puzzle from centerofmath.org via Twitter: There is a ten-digit number
I came across this question from interviewstreet.com Machines have once again attacked the kingdom
I have a Xcode project generated by Unity3D. Out of nowhere came this error.
I came across this link flying twitter bird , was just wondering , how
I was researching Scala DB frameworks/wrappers, and came across Gizzard, from Twitter. While I
Came across this error when trying out the ruby on rails tutorial section with
Came across this implementation of FxAA from NVidia. http://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf http://timothylottes.blogspot.in/2011/12/fxaa-40-stills-and-features.html The source code as
Came across this error today. Wondering if anyone can tell me what it means:
This came up from this answer to a previous question of mine . Is
Viewing the Twitter source and i came across this. Strange to see an '

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.