Jump to content

refresh


sandy1028

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 protected]&subject=Hi&query=hi&submit=Submit+Query

 

How to clear the data in URL after ?  name=abc&address=abc&[email protected]&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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.