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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:09:06+00:00 2026-06-16T20:09:06+00:00

I want to pass a url as a parameter in my PHP script. The

  • 0

I want to pass a url as a parameter in my PHP script. The URL is coming from my Android app which passes a url and the PHP script custom formats XML to return to the app. So I would pass the url I wanted to format and the PHP script would do stuff and echo the results.

For instance I want to pass this url:

differentwebpage.com/search/?query=ford%20f150&

in my php script (mywebpage.com/script.php):

$url = $_GET['url'];
$str = file_get_contents($url);
echo $str;

So the full url would be:

mywebpage.com/script.php?url=differentwebpage.com/search/?query=ford%20f150&

But this doesn’t work. I think I need to URL encode/decode but I haven’t had any success. How can I pass a full URL as a parameter?

  • 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-06-16T20:09:08+00:00Added an answer on June 16, 2026 at 8:09 pm

    Try encoding it in Android when you pass it.

    You can encode using the URLEncoder here: http://developer.android.com/reference/java/net/URLEncoder.html

    You can then easily unencode it in PHP using urldecode.

    $url = urldecode($_GET['url']);
    $str = file_get_contents($url);
    echo $str;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From my android app, I want to call php web services. At times, I
I want to pass any text as a get parameter to a php script.
Im trying to pass some variables from the URL to the PHP script. Now
I want to pass parameters from PHP Command Line Interface, and then read in
I want to pass a dynamic parameter with qTip, but it fails. my_ajax_controller.php just
I have problem to pass value via url parameter to other page. I want
I want to take URL parameter and pass to ajax function, var queryParams =
I want to pass a url like http://example.com/test?a=1&b=2 in url segment of codeigniter. I'm
i want to pass the 'query' in the url .i.e in q=..how to do
My data is just number, I want pass it from VC1 to VC2 for

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.