Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Subdomena, jak dodac z poziomu php
eai
post
Post #1





Grupa: Zarejestrowani
Postów: 367
Pomógł: 10
Dołączył: 20.05.2005

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


Jest jakas funkcja w php abym mogl z poziomu php dodac subdomene??

exec(); system(); (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) ?

I jakie polecenie trzeba wpisac.

please help!
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
AndyPSV
post
Post #2





Grupa: Zarejestrowani
Postów: 393
Pomógł: 5
Dołączył: 6.02.2003
Skąd: The.Luciferian.Doctrine.p
df

Ostrzeżenie: (30%)
XX---


Ja używam czegoś podobnego (dla domeny cfaniak.pl):

  1. <?php
  2.  
  3. $url = 'http://cfaniak.pl/cfaniak/index';
  4.  
  5. function SeparateString($string) {
  6. $lenght = strlen($string);
  7. $domain = substr($string, 0, $lenght-11);
  8. return $domain;
  9. }
  10.  
  11. if($_SERVER['HTTP_HOST'] == 'cfaniak.pl' OR $_SERVER['HTTP_HOST'] == 'www.cfaniak.pl') {
  12. header('Location: '.$url);
  13. } else {
  14. if(substr($_SERVER['HTTP_HOST'], 0, 3) == 'www') {
  15. $string = substr($_SERVER['HTTP_HOST'], 4);
  16. $result = SeparateString($string);
  17. echo $result;
  18. } else {
  19. $result = SeparateString($_SERVER['HTTP_HOST']);
  20. echo $result;
  21. }
  22. }
  23.  
  24. ?>


wystarczy tylko np. pobrac z bazy potrzebne dane i dac header();
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: 7.10.2025 - 23:53