Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> in_array nie działa
AboutMe
post
Post #1





Grupa: Zarejestrowani
Postów: 261
Pomógł: 0
Dołączył: 24.02.2008

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


Dzień dobry.

Co jest nie tak z tym kodem? Gdy jestem na stronie zawierającej w URL register ciągle wyświetla b zamiast a

  1. <?php
  2. $safePages = array("login", "register");
  3. $url = $_SERVER["REQUEST_URI"];
  4. if ( in_array( $url, $safePages ) ) { ?>
  5. a
  6. <?php } else { ?>
  7. b
  8. <?php } ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 5)
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




var_dump($url);
a wszystko bedzie jasne.... przenosze na przedszkole
Go to the top of the page
+Quote Post
AboutMe
post
Post #3





Grupa: Zarejestrowani
Postów: 261
Pomógł: 0
Dołączył: 24.02.2008

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


Jest

  1. string(13) "/1b/register/"
  2.  
  3. b



Ten post edytował AboutMe 12.12.2014, 14:15:29
Go to the top of the page
+Quote Post
Turson
post
Post #4





Grupa: Zarejestrowani
Postów: 4 291
Pomógł: 829
Dołączył: 14.02.2009
Skąd: łódź

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


A czy /1b/register/ i register to jest to samo..?
Go to the top of the page
+Quote Post
nospor
post
Post #5





Grupa: Moderatorzy
Postów: 36 559
Pomógł: 6315
Dołączył: 27.12.2004




Turson wg niego tak (IMG:style_emoticons/default/wink.gif)
Go to the top of the page
+Quote Post
AboutMe
post
Post #6





Grupa: Zarejestrowani
Postów: 261
Pomógł: 0
Dołączył: 24.02.2008

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


A sorry, myślałem że ta funkcja inaczej działa.

Ten post edytował AboutMe 12.12.2014, 14:20:15
Go to the top of the page
+Quote Post

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: 29.09.2025 - 16:27