Folosesc functia fopen() pentru a deschide si scrie intr-un fisier. Dar nu reusesc sa pun la punct sintaxa pentru deschiderea unui fisier atunci cand fisierul php se afla intr-un director iar fisierul pe care vreau sa-l deschid se afla in altul. De ex fis. php se afla in dir MODULE, iar fis care trebuie deschis se afla in dir. $MODUL (unde $modul este numele directorului introdus in mod interactiv). Am incercat ceva de genul
if (!$handle = fopen("/module/$modul/$filename", 'a+')), dar primesc un mesaj de eroare. Am incercat si fara ghilimele, si cu slash-urile invers, Nu am reusit. Ce functie trebuie sa folosesc? Ma ajuta cineva?!
Multumesc!
Calea catre un fisier din alt director
Moderatori: Zamolxe, Moderatori
-
diaconuliviu
- PHPRomania Supporter
- Mesaje: 15
- Membru din: Joi Feb 19, 2004 3:21 pm
-
diaconuliviu
- PHPRomania Supporter
- Mesaje: 15
- Membru din: Joi Feb 19, 2004 3:21 pm
-
diaconuliviu
- PHPRomania Supporter
- Mesaje: 15
- Membru din: Joi Feb 19, 2004 3:21 pm
de ce nu-i generezi extensie?
uite :
If PHP has decided that filename specifies a registered protocol, and that protocol is registered as a network URL, PHP will check to make sure that allow_url_fopen is enabled. If it is switched off, PHP will emit a warning and the fopen call will fail.
--------
allow_url_fopen boolean(true sau false)
asta e in configurare, vezi in manual...
This option enables the URL-aware fopen wrappers that enable accessing URL object like files. Default wrappers are provided for the access of remote files using the ftp or http protocol, some extensions like zlib may register additional wrappers.
Notã: This option was introduced immediately after the release of version 4.0.3. For versions up to and including 4.0.3 you can only disable this feature at compile time by using the configuration switch --disable-url-fopen-wrapper.
incearca sa-i generezi si extensie..
uite :
If PHP has decided that filename specifies a registered protocol, and that protocol is registered as a network URL, PHP will check to make sure that allow_url_fopen is enabled. If it is switched off, PHP will emit a warning and the fopen call will fail.
--------
allow_url_fopen boolean(true sau false)
asta e in configurare, vezi in manual...
This option enables the URL-aware fopen wrappers that enable accessing URL object like files. Default wrappers are provided for the access of remote files using the ftp or http protocol, some extensions like zlib may register additional wrappers.
Notã: This option was introduced immediately after the release of version 4.0.3. For versions up to and including 4.0.3 you can only disable this feature at compile time by using the configuration switch --disable-url-fopen-wrapper.
incearca sa-i generezi si extensie..
People ask for criticism, but they only want praise.
W. Somerset Maugham (1874 - 1965).
http://www.arond-design.ro
W. Somerset Maugham (1874 - 1965).
http://www.arond-design.ro
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 15 vizitatori