login  Naam:   Wachtwoord: 
Registreer je!
 Forum
Zoeken  Regels  Help
Categorieën > PHP

is_writable() absolute path? (Opgelost)

nick5556 – 16/03/2010 21:17
Ik maak voor mijn CMS'je een install file waarin ik controleer of configuration.php wel herschreven mag worden. Dit doe ik met PHP.net: is_writable. Het probleem is alleen dat als ik mijn controle uitvoer, dat er dan altijd 'Nee' uit komt. Ik heb de map en het bestand 0777 rechten gegeven.

Code:
  1. if(is_writable('../../includes/configuration.php')) {
  2. $cfgfile = "<span class=\"green\">Ja.</span>";
  3. } else {
  4. $cfgfile = "<span class=\"red\">Nee.<img src=\"images/error/error.jpg\" alt=\"error\" class=\"error_js\" /></span>";
  5. }



Nick

4 antwoorden

Gesponsorde links

Stijn – 16/03/2010 21:50
Kijk eens met PHP.net: file_exists of het bestand wel bestaat.

nick5556 – 17/03/2010 11:24
Het path naar het bestand vanuit de root is zo:
'includes/configuration.php'

Vanuit de root naar het instalatie bestandje is zo:
'install/pages/0.php'

Dan moet het pad toch zo zijn:
'../../includes/configuration.php'
?

'0.php' include ik in 'install.php' die in de map 'install/' staat.

TotempaaltJ – 17/03/2010 17:22
Maar probeer het alsnog eens. Niet er omheen draaien, gewoon testen!

Koen – 17/03/2010 17:33
Aangezien 0.php in install.php wordt geïnclude is het pad '../includes/configuration.php'.

Gesponsorde links

Dit onderwerp is gesloten.
Actieve forumberichten:

© 2002-2012 Sitemasters.be - Regels - Gehost door: Vircon - Laadtijd: 0.049s