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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:03:12+00:00 2026-05-15T20:03:12+00:00

First off, I do not want what is in the URL query. I want

  • 0

First off, I do not want what is in the URL query. I want what PHP see’s in the$_GET array.

This is because the URL query will not show all the params if mod_rewrite has been used to make pretty URLs

So is there a way to get the query string that would match exactly what is in the php $_GET array?

—

I came up with a way myself using PHP and JavaScript like so:

function query_string()
{
    <?php
        function assoc_array_to_string ($arr)
        {
            $a = array();
            foreach($arr as $key => $value)
            {
                $str = $key.'='.$value;
                $a[] = $str;
            }
            return implode("&",$a);
        }
    ?>
    return '<?=urlencode(assoc_array_to_string($_GET))?>';
}

…but I need to do this with just javascript if possible because I can’t put PHP code in a .js file.

  • 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-15T20:03:12+00:00Added an answer on May 15, 2026 at 8:03 pm

    Won’t JavaScript “only see” the query string? How would client-side script know about any rewrite rules?

    The only way I can think of is to use PHP — echo it into a variable in an inline script in your main page rather than the JS file.

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

Sidebar

Related Questions

First off I want to say that I am not using threads or multiple
First off, this is NOT a duplicate of: Turn a C string with NULL
First off, this question is not what does the constructor property do? - There's
First of all i want to start off by saying I'm kind of a
First off, I am not trying to write to the SDCard. I want to
First off I want to be clear that I am not referring to simulcasting
First off, let me say that this is not homework (I am an A-Level
So, first off, this is homework, albeit not mine. It's my brother-in-law's. He asked
Now, first off, I want to understand whether or not its better to use
First off: I do not want to use JQuery, i know it would make

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.