Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Jak wyświetlić na stronie adres z przeglądarki
motor
post
Post #1





Grupa: Zarejestrowani
Postów: 211
Pomógł: 0
Dołączył: 15.12.2005

Ostrzeżenie: (0%)
-----


Jak wyświetlić na stronie adres pod którym obecnie się znajduję np
www.strona.pl/plikinp.php?karta=1&zakladaka=2

Ten post edytował motor 28.10.2006, 10:37:41
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
motor
post
Post #2





Grupa: Zarejestrowani
Postów: 211
Pomógł: 0
Dołączył: 15.12.2005

Ostrzeżenie: (0%)
-----


Super bardzo dziękuję , tego mi było trzeba (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
  1. <?php
  2. function setGetVar($var, $val){
  3.  $request_uri = $_SERVER["REQUEST_URI"];
  4.  if(strstr($request_uri, $var)) {
  5.  return preg_replace("/$var=[dw]*/", "$var=$val", $request_uri);
  6.  } elseif(strstr($request_uri, "?")) {
  7.  return $request_uri . "&" . $var . "=" . $val;
  8.  } else {
  9.  return $request_uri . "?" . $var . "=" . $val;
  10.  }
  11. }
  12. ?>
  13.  
  14. <a href="<?php echo setGetVar("orderby", "lname"); ?>">Sort by Last Name</a>
  15. <a href="<?php echo setGetVar("orderby", "fname"); ?>">Sort by First Name</a>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 07:26