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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:16:02+00:00 2026-06-12T06:16:02+00:00

How to hide parameters (query_string) in url but send them to page hidden, not

  • 0

How to hide parameters (query_string) in url but send them to page hidden, not visible in address bar

example:
I have this:

http://localhost/index.php?sent=true

i want:

http://localhost/index.php

but i want to get sent parameter in PHP $_GET[‘sent’]

i tried to redirect to page with no parameters(no query_string) [R] and after that give page some parameters (silently) without [R] redirection (without changing adress itself)

i tried to use RewriteRule in htaccess with different flags and different ways but nothing worked

i learned that if i want to change address in browser, i must use R flag with L flag in one RewriteRule line – other way it does not work – adress does not change

but when i use [L] flag i cannot go to next line(next RewriteRule) and append any query_string to address without [R] redirection

if i don’t put an [L] flag in first line (with [R]) i don’t have new address but if i do – i can’t use [C] flag or even [N] flag


Here is why:

on my page i use header(‘Location: …?sent=true’) function after successful data sent from Form
i redirect to ?sent=true because of i don’t want to user refresh page and send the same data again

but after redirect to ?sent=true i don’t want to have that query_string in address bar
there are more forms on that page that will send other POST data and refresh page with this ugly query_string there

how to do that?

  • 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-12T06:16:03+00:00Added an answer on June 12, 2026 at 6:16 am

    You could just set it so that if you visit a script with ?sent=true once it has finished, it redirects the user

    e.g.

    if(!empty($_GET['sent'])&&$_GET['sent']) {
        //do stuff
        header("Location: http://localhost/index.php");
    }
    

    You can’t do this with htaccess as you need to pass to PHP, it’s passed to PHP after redirection so if you redirect with htaccess the value will never get to PHP.


    Further question, the only way to do this then is to redirect the user with a javascript form

    <?php if(!empty($_GET['sent'])&&$_GET['sent']) { ?>
    <form action='http://localhost/index.php' method='post' name='frm'>
        <?php
        foreach ($_GET as $a => $b) {
            echo "<input type='hidden' name='".$a."' value='".$b."'>";
        }
        ?>
        </form>
        <script language="JavaScript">
            document.frm.submit();
        </script>
    <?php } ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I hide the parameters in Codeigniter? I have this URL: http://example.com/profile/1 I
I have a $.get() call to a PHP page that takes 4 GET parameters.
I usually work with .NET but I have a php page that calls an
I want to hide parameters from URL. I'm using uuids instead of ids and
How to hide the query string parameter in address bar. i don't want to
Using MVC2 Have a master-page that needs to hide certain menus if currently logged
What is the correct way to hide the /index action while having url parameters
I have four parameters on my report. Three of them are required for the
I want to hide the parameters which are attached in my url . My
I want to query the hide/show status of parameters of a report. But it

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.