Re: short adress
| From: | Felipe Gasper | Date: | Thu, 07 Oct 2004 11:54:56 +0000 |
| Subject: | Re: short adress | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-24714@lists.php.net to get a copy of this message | ||
If I understand you correctly, you could create an intermediary HTML POST form with all the variables from the URL's query string that, via Javascript, submits automatically.
Like this:
----------------------------------
<?php
preg_match('/^([^?]*)\?.*/',$REQUEST_URI,$urlMatch);
$bareUrl = $urlMatch[1];
print "<html><head><title></title></head><body><form method="post" action=\"".htmlspecialchars($bareUrl)."\">";
foreach ($_GET as $key => $val) {
$key = htmlspecialchars($key);
$val = htmlspecialchars($val);
print "<input type='hidden' name=\"$key\" value=\"$val\" />";
}
print "</form>";
print "<script type='text/javascript'>document.forms[0].submit();</script>";
print "</body></html>";
?>
---------------------------------
There may be a way to do it without Javascript. This does actually reload the page, I guess, but it's minimal traffic for doing so.
-Felipe Gasper
Quoth Александр Ильяшов on 10/7/2004 8:08 AM...
Hello. Do you know how to change adress such "http://server.lg.ua/index.php?par1=temp1&par2=temp2..." to "http://server.lg.ua/" without reloading page? I saw it in phpmyadmin where long adresses change to short. sorry my English -- Alexander ICQ: 244-030-537 Odigo: silya@odigo.com-- Quidquid latine scriptum sit altum viditur. Si hoc legere scis, nimis eruditionis habes. Easier web browsing: http://mozilla.org