Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP] zmiana id w adresie na tytul - nie dziala
Michał90
post
Post #1





Grupa: Zarejestrowani
Postów: 267
Pomógł: 0
Dołączył: 16.05.2007

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


Witam,

  1. $query = mysql_query("select * from `games` where category = '" . clean($_GET['id']) . "'$limit ");
  2. while($row = mysql_fetch_array($query)) {
  3.  
  4. echo '<a href="' . $siteurl . 'games/' . $row['id'] . '/">' . $row['title'] . '</a>';
  5. }


Aktualnie gdy kliknę w utworzony link to wygląda on tak: http://adres.pl/games/342/ i działa OK
Jak zrobić, żeby link wyglądał tak:

http://adres.pl/games/NAZWAGRY/

Gdy zrobie tak:

  1. $query = mysql_query("select * from `games` where category = '" . clean($_GET['id']) . "'$limit ");
  2. while($row = mysql_fetch_array($query)) {
  3.  
  4. echo '<a href="' . $siteurl . 'games/' . $row['title'] . '/">' . $row['title'] . '</a>';
  5. }


To link wygląda tak jak chce czyli:
http://adres.pl/games/NAZWAGRY/

Ale niestety ten link nie działa...

Co zrobić, żeby działało to poprawnie?

Pozdrawiam



Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Michał90
post
Post #2





Grupa: Zarejestrowani
Postów: 267
Pomógł: 0
Dołączył: 16.05.2007

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


  1. Options +FollowSymLinks
  2. RewriteEngine on
  3.  
  4. RewriteRule "^games/([0-9]+)/$" gamer.php?id=$1 [Last]


Ten post edytował Michał90 28.02.2010, 19:54:20
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: 10.10.2025 - 16:56