Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> 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

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: 22.08.2025 - 14:24