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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:08:02+00:00 2026-06-14T23:08:02+00:00

What is the proper protocol for storing other websites URL’s in your own php

  • 0

What is the proper protocol for storing other websites URL’s in your own php page’s URL?

For example if I wanted to store google it would be easy.

MySite.com/test.php?url=http://www.google.com


But what about a URL more complex than http://www.google.com, like if I wanted to store another website’s PHP page.

(e.g. http://www.AnotherSite.com/page1.php?key=value&key2=value2&key3=value3)

Then how would I store it in my PHP page’s URL? Do you replace all of the “&” symbols with a “\&” phrase? Is there a better method? Does that even work in the first place?


Thanks!!!

  • 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-14T23:08:03+00:00Added an answer on June 14, 2026 at 11:08 pm

    If you don’t want to think about it:

    $url = 'mysite.com/test.php?' . http_build_query(array(
        'url' => $anything_you_want,
    ));
    

    Otherwise:

    $url = 'mysite.com/test.php?url=' . urlencode($anything_you_want);
    

    You could also use rawurlencode(). Notable difference is that it follows RFC 3986.

    Further reading:

    http_build_query()
    urlencode()
    rawurlencode()

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

Sidebar

Related Questions

I use .htaccess RewriteRules to pass the url to index.php. If the specified page
I use PHP to get a list of folders, and then documents from Google
I currently have a url that looks like this: protocol://folder/file.js I can open this
Does google protocol buffers support stl vectors, maps and boost shared pointers? I have
EDIT : proper solution: void add(Student s) { if(root == null) root = new
xml is not encoding proper - any help List<NameValuePair> formparams = new ArrayList<NameValuePair>(); formparams.add(new
What is the proper method to set the focus onload to first field in
I was looking a proper way to implment a ScaleAnimation. My purpose is to
What's the proper way to add a literal text value from a field to
What are the proper ways of adding a common set of method/properties to subclasses

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.