Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> parse_url, Jak parse_url("...") wyświetlić całą ..
neo.priv
post
Post #1





Grupa: Zarejestrowani
Postów: 78
Pomógł: 0
Dołączył: 27.02.2004

Ostrzeżenie: (10%)
X----


Witam, przy pomocy

  1. <?php
  2.  
  3. $adres = parse_url("...")
  4.  
  5. ?>


wyciągnołem sobie czesc adresu URL i go podmienilem

  1. <?php
  2.  
  3. $replace = str_replace("oo.com", "bbb.pl", $host);
  4.  
  5. ?>


teraz chciałbym wysłąc do przeglądarki informacje z nowym adresem, lecz nie zabardz wiem jak.

Robiąć tak:
  1. <?php
  2.  
  3. print( $replace );
  4.  
  5. ?>


a

ptezymuje komuniktat
  1. Array


  1. <?php
  2.  
  3. header("Location: $replace "); 
  4.  
  5. ?>


wyslyła mnie do strony z błędem - brak tej strony

Rozumie ze tablica jest pusta.

Przy pomoce jakiej funkci moge wyświetlić caly adres po podmianie funkcja str_replace?


--------------------
Warsztst: Apache 1.3.31 | PHP 4.3.7RC1 | MySQL 4.0.18
Na warsztacie: RU llllllllll 98%
Go to the top of the page
+Quote Post
czachor
post
Post #2





Grupa: Zarejestrowani
Postów: 897
Pomógł: 40
Dołączył: 16.12.2003
Skąd: Warszawa

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


Kod
print_r($replace);


--------------------
how many SEO experts does it take to change a light bulb,lightbulb,light,bulb,lamp,lighting,switch,sex,xxx
5-Reasons-why-you-should-NEVER-fix-a-computer-for-free
Go to the top of the page
+Quote Post
neo.priv
post
Post #3





Grupa: Zarejestrowani
Postów: 78
Pomógł: 0
Dołączył: 27.02.2004

Ostrzeżenie: (10%)
X----


  1. <?php
  2.  
  3. print_r($replace)
  4.  
  5. ?>


daje mi nastepujący komunikat

  1. Array ( [scheme] => http [host] => bbb.pl )


i nie da sie go inaczej wlorzyc do

  1. <?php
  2.  
  3. header("Location: $replace ");
  4.  
  5. ?>


questionmark.gif?


--------------------
Warsztst: Apache 1.3.31 | PHP 4.3.7RC1 | MySQL 4.0.18
Na warsztacie: RU llllllllll 98%
Go to the top of the page
+Quote Post
hwao
post
Post #4


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




Sklej to w caly url i bedzie... (masz tablice, musisz posklejac to w url)

parse_url" title="Zobacz w manualu php" target="_manual()
Go to the top of the page
+Quote Post
neo.priv
post
Post #5





Grupa: Zarejestrowani
Postów: 78
Pomógł: 0
Dołączył: 27.02.2004

Ostrzeżenie: (10%)
X----


  1. <?php
  2.  
  3. print($replace[scheme]."://".$replace[host].$replace[path]);
  4.  
  5. ?>


Działa.


--------------------
Warsztst: Apache 1.3.31 | PHP 4.3.7RC1 | MySQL 4.0.18
Na warsztacie: RU llllllllll 98%
Go to the top of the page
+Quote Post
czachor
post
Post #6





Grupa: Zarejestrowani
Postów: 897
Pomógł: 40
Dołączył: 16.12.2003
Skąd: Warszawa

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


Mały szczegół, ale w sumie istotny. Apostrofy (włącz sobie E_ALL):
  1. <?php
  2. print($replace['scheme']."://".$replace['host'].$replace['path']);
  3. ?>


--------------------
how many SEO experts does it take to change a light bulb,lightbulb,light,bulb,lamp,lighting,switch,sex,xxx
5-Reasons-why-you-should-NEVER-fix-a-computer-for-free
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 20.08.2025 - 06:16