ckrudelux Posted July 14, 2009 Report Share Posted July 14, 2009 Okay so I have a code for creating a file with some context. But I the file thats exicutes this is in a sub folder so I need it to go back on step I thought what I could use a / infront of the name but it doesn't work. $dbc = fopen("/dbUser.php","w") or exit("Unable to open file or create one!");fwrite($dbc, '<?php');fwrite($dbc, '$host = "'.$host.'";');fwrite($dbc, '$user = "'.$user.'";');fwrite($dbc, '$password = "'.$pass.'";');fwrite($dbc, '?>');fclose($dbc); Link to comment Share on other sites More sharing options...
justsomeguy Posted July 14, 2009 Report Share Posted July 14, 2009 Use ../ to refer to the parent directory. Link to comment Share on other sites More sharing options...
ckrudelux Posted July 14, 2009 Author Report Share Posted July 14, 2009 Use ../ to refer to the parent directory.Thanks seems like it works now:) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now