makka Posted May 14, 2007 Share Posted May 14, 2007 hay i need to make a file and call it a variable (the users name) it is a registration script and they get a file each eg i make an account and i call my name makka then the script will make a new file called makka in side of a file called userfiles any help? Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/ Share on other sites More sharing options...
Daleeburg Posted May 14, 2007 Share Posted May 14, 2007 how are you storing the user names, cause i think you could do somthing along this line. <?php $doc = fopen ($user.".doc", "w"); fwrite ($doc,'first line'); fwrite ($doc,'second line'); //so on and so forth fclose ($doc); ?> that is untested and i am very tired so dont take it as perfect. ~D Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-252770 Share on other sites More sharing options...
makka Posted May 14, 2007 Author Share Posted May 14, 2007 no i would like a normal file so after it has made it it will then be www.domain.com/userfiles/makka/whatever Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-252812 Share on other sites More sharing options...
Daleeburg Posted May 14, 2007 Share Posted May 14, 2007 oh sorry. so you want it to make a user directory. i think this may help http://us.php.net/function.mkdir Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-252825 Share on other sites More sharing options...
makka Posted May 14, 2007 Author Share Posted May 14, 2007 thanks ill take a look if i still need help ill bump this up Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-252829 Share on other sites More sharing options...
makka Posted May 14, 2007 Author Share Posted May 14, 2007 mkdir didn't work?? i tried it in just a small script and it sayes it worked but then when i go to have a look its not there id i refresh it says it all ready exists Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-253081 Share on other sites More sharing options...
makka Posted May 15, 2007 Author Share Posted May 15, 2007 bump Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-253684 Share on other sites More sharing options...
makka Posted May 15, 2007 Author Share Posted May 15, 2007 bump Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-253863 Share on other sites More sharing options...
lewis987 Posted May 15, 2007 Share Posted May 15, 2007 post your code you used for mkdir() Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-253869 Share on other sites More sharing options...
makka Posted May 15, 2007 Author Share Posted May 15, 2007 mkdir('/fuckup/'); mkdir('/fuckup'); mkdir(/fuckup) and i had those numbers on the end sorry for the file name first thing that came to my head Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-253886 Share on other sites More sharing options...
lewis987 Posted May 15, 2007 Share Posted May 15, 2007 ok, so u want to make a folder called "fuckup"? mkdir("/fuckup",0755); that whould work, if its a windows machine your running it will be: mkdir("\fuckup",0755) Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-253894 Share on other sites More sharing options...
makka Posted May 15, 2007 Author Share Posted May 15, 2007 thanks sorry about the name i was getting pissed off :S and nope still wont show up :S im running vista using xamp Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-253911 Share on other sites More sharing options...
makka Posted May 16, 2007 Author Share Posted May 16, 2007 bump Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-254574 Share on other sites More sharing options...
taith Posted May 16, 2007 Share Posted May 16, 2007 the folder your making it in... it has read/write privilages? Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-254579 Share on other sites More sharing options...
john010117 Posted May 16, 2007 Share Posted May 16, 2007 Also, try putting in the full directory path(s). Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-254583 Share on other sites More sharing options...
makka Posted May 16, 2007 Author Share Posted May 16, 2007 thanks yeah i have all thou it is vista which asks you twice is you are sure but... but is some one could just whip up a script they have tested for a host that will make a file by the by the name of what ever the variable $username is Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-254691 Share on other sites More sharing options...
makka Posted May 17, 2007 Author Share Posted May 17, 2007 thanks yeah i have all thou it is vista which asks you twice is you are sure but... but is some one could just whip up a script they have tested for a host that will make a file by the by the name of what ever the variable $username is Link to comment https://forums.phpfreaks.com/topic/51325-making-a-file/#findComment-255167 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.