Jump to content

[SOLVED] information in Seperate Directory


TheJoey

Recommended Posts

Placing information in a Seperate Directory for each register user.

file_put_contents('../logins/'.$username.'_type_username.txt', 'Done');
file_put_contents('../logins/'.$password.'_type_password.txt', 'Done');
file_put_contents('../logins/'.$name.'_type_profilename.txt', 'Done');
file_put_contents('../logins/'.$email.'_type_profileemail.txt', 'Done');

 

So if user Me registers a folder me will be created

thanks in advance

Link to comment
Share on other sites

This is a dangerous way to collect user information, Why are you doing that , especially each user having 4 files for such little information?

 

You're not even asking a question, what is it you want us to help you with? If you're wanting to create a new folder..

file_put_contents('../logins/'.$username.'/'.$username.'_type_username.txt', 'Done');

Link to comment
Share on other sites

well it makes it easier for me to proccess.

At the moment its placing 4 files in logins folder.

 

is there a way to make it so when "me" registers a folder in logins called "ME" is where the information is stored.

Is there a way of putting all that info into one file.

 

When i tried it messed up all my code because it was reading it wrongly.

Link to comment
Share on other sites

well it makes it easier for me to proccess.

At the moment its placing 4 files in logins folder.

 

is there a way to make it so when "me" registers a folder in logins called "ME" is where the information is stored.

Is there a way of putting all that info into one file.

 

When i tried it messed up all my code because it was reading it wrongly.

 

Use fread and fwrite instead of file_put_contents first of all to be able to write to the same file.. and use my code above to create a new folder per user.. It's basic but you get how it's done, just with the slashes.

Link to comment
Share on other sites

Warning: file_put_contents(../logins/Joe/Joe_type_username.txt) [function.file-put-contents]: failed to open stream: No such file or directory in C:\xampplite\htdocs\Trial\Login\register\reg.php on line 14

 

Warning: file_put_contents(../logins/Joe/joe_type_password.txt) [function.file-put-contents]: failed to open stream: No such file or directory in C:\xampplite\htdocs\Trial\Login\register\reg.php on line 15

 

Warning: file_put_contents(../logins/Joe/joe_type_name.txt) [function.file-put-contents]: failed to open stream: No such file or directory in C:\xampplite\htdocs\Trial\Login\register\reg.php on line 16

 

Warning: file_put_contents(../logins/Joe/joe_type_email.txt) [function.file-put-contents]: failed to open stream: No such file or directory in C:\xampplite\htdocs\Trial\Login\register\reg.php on line 17

file_put_contents('../logins/'.$username.'/'.$username.'_type_username.txt', 'Done');
file_put_contents('../logins/'.$username.'/'.$password.'_type_password.txt', 'Done');
file_put_contents('../logins/'.$username.'/'.$name.'_type_name.txt', 'Done');
file_put_contents('../logins/'.$username.'/'.$email.'_type_email.txt', 'Done');

 

im working on putting into fwrite

its just i find fwrite hard to work with due to recalling it

Link to comment
Share on other sites

Make your WWW folder read/write/execute in properties if available, and you'd use something such as mkdir to create a folder.. such as..

 

mkdir("../logins/$username/");
file_put_contents('../logins/'.$username.'/'.$username.'_type_username.txt', 'Done');

That might work..

 

like Name,age,email,password then repeats on the same line even after /n

You should type \n, not /n if that was your mistake

Link to comment
Share on other sites

fwrite($fp, $email."||".$fname."||".$lname."||".$age."||".$address."||".$city."\n");

that was my code

when viewed in notepad it was on same line in wordpad in was viewed per line

but when i do

<?php
    readfile("text.txt");
?>

it views the same notepad

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.