cdog5000 Posted August 12, 2008 Share Posted August 12, 2008 what function could i use to make a new file in a directory? Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 12, 2008 Share Posted August 12, 2008 typically fopen() or file_put_contents() http://us.php.net/manual/en/function.fopen.php http://us3.php.net/file_put_contents Quote Link to comment Share on other sites More sharing options...
cdog5000 Posted August 12, 2008 Author Share Posted August 12, 2008 typically fopen() or file_put_contents() http://us.php.net/manual/en/function.fopen.php http://us3.php.net/file_put_contents how would i make it make the file? i get this error trying it... Warning: fopen(./chat/cdog50006.txt) [function.fopen]: failed to open stream: No such file or directory in /home/neweraim/public_html/auth/userRegister.php on line 37 Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 12, 2008 Share Posted August 12, 2008 Show some code. Quote Link to comment Share on other sites More sharing options...
cdog5000 Posted August 12, 2008 Author Share Posted August 12, 2008 fopen('./chat/'.$username . '.txt','x+'); Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 12, 2008 Share Posted August 12, 2008 if the "chat" dir doesn't already exist it will upset the function... in that case you could use mkdir() to make the dir before creating a file in it. Quote Link to comment Share on other sites More sharing options...
cdog5000 Posted August 12, 2008 Author Share Posted August 12, 2008 Warning: fopen(./chat/cdog50006.txt) [function.fopen]: failed to open stream: No such file or directory in /home/neweraim/public_html/auth/userRegister.php on line 37 and fopen('./chat/'.$username . '.txt','x+'); and yes it its a directory Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 12, 2008 Share Posted August 12, 2008 Have you created the chat directory at /home/neweraim/public_html/auth/chat/ ? Â EDIT: nevermind, I didn't see that you said it was already a directory. Â Try removing the ./ Â fopen('chat/cdog50006.txt'); Â or whatever. Quote Link to comment Share on other sites More sharing options...
amatz Posted August 12, 2008 Share Posted August 12, 2008 every body can help me?,  i am a Beginer of the Php Software... i have a problem about the Odbc connection in Php. how can i connect the Odobc in Php. i have some warning encounter like this "Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'., SQL state 37000 in SQLExecDirect in D:\online_grading\studview1.php on line 8".  pls help me godbless to every one!!!..   Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 12, 2008 Share Posted August 12, 2008 create your own thread, amatz, this is about cdog's problem. Quote Link to comment Share on other sites More sharing options...
cdog5000 Posted August 12, 2008 Author Share Posted August 12, 2008 Warning: fopen(chat/cdog5000900.txt) [function.fopen]: failed to open stream: No such file or directory in /home/neweraim/public_html/auth/userRegister.php on line 37 Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 12, 2008 Share Posted August 12, 2008 it shouldn't be giving that error if you have created the chat directory in your auth directory....  try running  mkdir('chat'); fopen('chat/cdog5000900.txt');  once. Quote Link to comment Share on other sites More sharing options...
cdog5000 Posted August 12, 2008 Author Share Posted August 12, 2008 Warning: mkdir() [function.mkdir]: Permission denied in /home/neweraim/public_html/auth/la.php on line 10 Warning: fopen(chat/cdog5000900.txt) [function.fopen]: failed to open stream: No such file or directory in /home/neweraim/public_html/auth/la.php on line 11 Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 12, 2008 Share Posted August 12, 2008 Apparently you don't have permission to create directories, contact your server admin to get such permissions, or if you're the admin, give yourself them . Quote Link to comment Share on other sites More sharing options...
cdog5000 Posted August 12, 2008 Author Share Posted August 12, 2008 Apparently you don't have permission to create directories, contact your server admin to get such permissions. i have chmod'd my stuff and it still say's that.... Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 12, 2008 Share Posted August 12, 2008 what command did you run? sudo chmod 777? Quote Link to comment Share on other sites More sharing options...
cdog5000 Posted August 12, 2008 Author Share Posted August 12, 2008 what command did you run? sudo chmod 777? yes Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted August 12, 2008 Share Posted August 12, 2008 If I trust you that you said you created the chat directory by hand in the proper place, it might cause the access denied error. I have no idea what your problem is, sorry. Â Try fopen()ing a file (that doesn't exist) in the current directory... eg. remove the /chat/ from the equation, and see if it still says the file does not exist. Quote Link to comment Share on other sites More sharing options...
cdog5000 Posted August 12, 2008 Author Share Posted August 12, 2008 If I trust you that you said you created the chat directory by hand in the proper place, it might cause the access denied error. I have no idea what your problem is, sorry.  Try fopen()ing a file (that doesn't exist) in the current directory... eg. remove the /chat/ from the equation, and see if it still says the file does not exist. ok... will do Quote Link to comment Share on other sites More sharing options...
cdog5000 Posted August 12, 2008 Author Share Posted August 12, 2008 ok... i tried doing: fopen('http://new-era.impsoft.info/auth/la.php','x+'); and it is working atm so i will try this Quote Link to comment Share on other sites More sharing options...
cdog5000 Posted August 12, 2008 Author Share Posted August 12, 2008 ok... i tried doing: fopen('http://new-era.impsoft.info/auth/la.php','x+'); and it is working atm so i will try this ok... it is not creating the file.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.