Tools, FAQ, Tutorials:
Retrieving the Original Query String in PHP
How To Retrieve the Original Query String in PHP?
✍: FYIcenter.com
If you have coded some values in the URL without using the standard form GET format, you need to retrieve those values in the original query string in $_SERVER['QUERY_STRING']. The script below is an enhanced version of processing_forms.php which print the original query string:
<?php
print("<html><pre>");
print(" query_string = {$_SERVER['QUERY_STRING']}\n");
$count = count($_REQUEST);
print("Number of values: $count\n");
foreach ($_REQUEST as $key=>$value) {
if (is_array($value)) {
print(" $key is an array\n");
for ($i = 0; $i < count($value); $i++) {
$sub_value = $value[$i];
if (get_magic_quotes_gpc()) {
$sub_value = stripslashes($sub_value);
}
print(" ".$key."[".$i."] = ".$sub_value."\n");
}
} else {
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
print(" $key = $value\n");
}
}
print("</pre></html>\n");
?>
⇒ Protecting Special Characters in Query String in PHP
2016-11-05, ∼2079🔥, 0💬
Popular Posts:
How to build a PHP script to dump Azure AD 2.0 Authentication Response? If you are use the Azure-AD-...
Why I am getting "The Windows SDK version 8.1 was not found" error, when building my C++ application...
Where to find EPUB Sample Files? Here is a list of EPUB sample files collected by FYIcenter.com team...
How To Truncate an Array in PHP? If you want to remove a chunk of values from an array, you can use ...
How to use the Atom Online Validator at w3.org? w3.org feed validation service is provided at http:/...