Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> funkcja..., ...tworząca folder i plik w nim
-Gość_Gość-
post
Post #1





Goście







Witam.
Mam taką funkcję:
  1. <?
  2. function CreateURL($dir,$url)
  3. {
  4. if(!is_dir($dir))
  5. {
  6. mkdir(&#092;"$dir\", 0777);
  7. $php_file=&#092;"<HTML><HEAD><META HTTP-EQUIV=Refresh CONTENT=0;URL=$url>
  8. <meta http-equiv=Content-Type content=text/html;charset=windows-1250><TITLE>Proszę czekać...</TITLE>
  9. </HEAD><BODY><p>Proszę czekać, trwa ładowanie strony.</p> 
  10. </BODY></HTML>&#092;";
  11. $fp = fopen(&#092;"/$dir/index.php\",\"w+\");
  12. chmod(&#092;"/$dir/index.php\",0755);
  13. fwrite($fp,&#092;"$php_file\");
  14. fclose($fp);
  15. }
  16. else
  17. {
  18. echo(&#092;"Taki folder już istnieje\");
  19. }
  20. }
  21. ?>

No i jak uruchamiam tą funkcję z $dir=suchar, a $url=http://suchar.net to są takie błędy:
Cytat
Warning: mkdir(http://sebszhost.com/ss/suchar): No such file or directory in /home/ss/public_html/add.php on line 6

Warning: fopen(http://sebszhost.com/~starken/suchar/index.php): failed to open stream: HTTP wrapper does not support writeable connections. in /home/starken/public_html/add.php on line 11

Warning: chmod(): No such file or directory in /home/ss/public_html/add.php on line 12

Warning: fwrite(): supplied argument is not a valid stream resource in /home/ss/public_html/add.php on line 13

Warning: fclose(): supplied argument is not a valid stream resource in /home/ss/public_html/add.php on line 14


Proszę o pomoc!
Go to the top of the page
+Quote Post
sobstel
post
Post #2





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

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


do sciezki nie odwolujesz sie poprzez adres http. sciezka jest inna np. /katalog albo /home/costam/~twojekonto/ itp.


--------------------
"If debugging is the process of removing bugs, then programming must be the process of putting them in..."
sobstel.org
Go to the top of the page
+Quote Post
Starken
post
Post #3





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 17.04.2005
Skąd: Bydgoszcz

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


Trochę pokręciłem z tymi błędami (to byłem ja, zapomniałem hasła tongue.gif). One takie były:
Cytat
Warning: mkdir(http://sebszhost.com/~starken/suchar): No such file or directory in /home/starken/public_html/add.php on line 6

Warning: fopen(http://sebszhost.com/~starken/suchar/index.php): failed to open stream: HTTP wrapper does not support writeable connections. in /home/starken/public_html/add.php on line 11

Warning: chmod(): No such file or directory in /home/starken/public_html/add.php on line 12

Warning: fwrite(): supplied argument is not a valid stream resource in /home/starken/public_html/add.php on line 13

Warning: fclose(): supplied argument is not a valid stream resource in /home/starken/public_html/add.php on line 14

EDIT:
Chociaż nie... przecież to to samo. No to nie rozmumiem cię w takim razie. Co mam zmienić w tej funkcji??

Ten post edytował Starken 21.04.2005, 17:35:08


--------------------
Polska przeprasza za Polaków
Go to the top of the page
+Quote Post
sobstel
post
Post #4





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

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


napisz jak wywolujesz ta funkcje


--------------------
"If debugging is the process of removing bugs, then programming must be the process of putting them in..."
sobstel.org
Go to the top of the page
+Quote Post
Starken
post
Post #5





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 17.04.2005
Skąd: Bydgoszcz

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


  1. <?
  2.  
  3. CreateURL($_GET[&#092;"dir\"],$_GET[\"url\"]);
  4.  
  5. ?>


--------------------
Polska przeprasza za Polaków
Go to the top of the page
+Quote Post
sobstel
post
Post #6





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

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


ok. ale jak dokladnie wygladaja $_GET["dir"] i $_GET["url"]


--------------------
"If debugging is the process of removing bugs, then programming must be the process of putting them in..."
sobstel.org
Go to the top of the page
+Quote Post
Starken
post
Post #7





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 17.04.2005
Skąd: Bydgoszcz

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


dir=suchar, url=http://suchar.net
sprawdzałem przez echo


--------------------
Polska przeprasza za Polaków
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: 19.08.2025 - 11:29