-
php create file in diff dir
Code:
<?php
chmod($_POST["loginID"], 0777);
$selecting = $_POST["loginID"];
chdir($selecting);
echo getcwd();
$ourFileHandle = fopen(getcwd() . "./password.txt", 'w') or die("can't create pass file");
fclose($ourFileHandle);
chmod("password.txt", 0777);
$fh = fopen("password.txt", 'a+') or die("can't write pass");
$stringData = $_POST["password"] . "\n";
fwrite($fh, $stringData);
fclose($fh);
?>
i cant make this work.. been trying all day... finaly gave up lol
it gives eror unable to locate file or if i use / after alst folder then gives SAFE MODE error
-
Re: php create file in diff dir
Use mkdir
mkdir("../newfolder");
-
Re: php create file in diff dir
its the new dir problem.. the file problem.. cant create new in that dir :(
-
Re: php create file in diff dir
I see - don't use getcwd(), use './password.txt' straight away.
-
Re: php create file in diff dir
but if i use './password.txt' then it will create the file in current dir?
where as to i want the file to go to dir/password.txt
-
Re: php create file in diff dir
Try '../' to go backwards '../differentfolder/password.txt'
-
Re: php create file in diff dir
why go backwards? O.O cuz folder is in the same place as php script
-
Re: php create file in diff dir
in that case use 'folder/password.txt'
-
Re: php create file in diff dir
i use this
Code:
fopen($_POST["loginID"] . "password.txt", 'w')
but fails...
it creates file not folder and file lol
-
Re: php create file in diff dir
mkdir($_POST["loginID"]);
fopen($_POST["loginID"] . "password.txt", 'w')
-
Re: php create file in diff dir
this wont work.. that way it makes (loginid)password.txt
like ... watever is input loginID it uses that loginIDpassword.txt
-
Re: php create file in diff dir
mkdir($_POST["loginID"]);
fopen($_POST["loginID"]. "/". "password.txt", 'w')
-
Re: php create file in diff dir
...To my understanding, you're trying to put User Passwords/Usernames in a text file?
Get out.
-
Re: php create file in diff dir
um is it posible to do like this
read input data
make $variable have the input data
and use $varibale as a locator
coz nothing works lol... php sux ass
-
Re: php create file in diff dir
You don't know much about PHP do you?
-
Re: php create file in diff dir
im studying for 2 days but ive done everything nothing work in this case lmao...i dont wana use sql yet.. not yet
-
Re: php create file in diff dir
paste your script raw here.
-
Re: php create file in diff dir
<?php
chmod($_POST["loginID"], 0777); //locate folder...
$selecting = "www/zxq.net/t/a/l/talismanrider/htdocs/accounts/" . $_POST["loginID"];
//chdir($selecting);
//echo getcwd();
$ourFileHandle = fopen($selecting."/"."password.txt", 'w') or die("can't create pass file");
fclose($ourFileHandle);
?>
-
Re: php create file in diff dir
replace with
<?php
$selecting = $_POST["loginID"];
$ourFileHandle = fopen($selecting."/"."password.txt", 'w') or die("can't create pass file");
fclose($ourFileHandle);
?>
-
Re: php create file in diff dir
-
Re: php create file in diff dir
-
Re: php create file in diff dir
ye i contacted the support they wont do it :D
-
Re: php create file in diff dir
that sucks. that's your next problem.
use horizon-host.com, i use their service for testing and the kit they provide is feature rich.
-
Re: php create file in diff dir
registered for this but will do more tomorow now wana relax and go sleep soon
thnx for the link ill post here more if i need any help