Jump to content

Creating A File Need Some Help


ckrudelux
 Share

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...