Jump to content

Recommended Posts

Hi,

 

I have passed the query string which is passed to same page...

After the submit button is clicked the values in the URL is not getting cleared

 

The URL is of the form ...../test.php?name=abc&address=abc&email=abc@xyz.com&subject=Hi&query=hi&submit=Submit+Query

 

How to clear the data in URL after ?  name=abc&address=abc&email=abc@xyz.com&subject=Hi&query=hi&submit=Submit+Query

 

 

Link to comment
https://forums.phpfreaks.com/topic/64643-refresh/#findComment-322282
Share on other sites

$_SERVER['PHP_SELF'];

Result:

/script.php

Without GET String.

 

Capture the data you need and redirect to the current page, Resulting in only the script name.

Example:

<?php
if (isset($_GET['Submit'])){
//Capture Data.
header("Location: ".$_SERVER['PHP_SELF']);
//Or using Javascript..
echo '<script>document.location = "' . $_SERVER['PHP_SELF'] . '";</script>';
exit;
}
echo 'Form'; // Your form can come here.
?>

Link to comment
https://forums.phpfreaks.com/topic/64643-refresh/#findComment-322287
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.