Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,161,493 members, 7,847,023 topics. Date: Saturday, 01 June 2024 at 09:38 AM

Php File Handling Help Needed - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Php File Handling Help Needed (2098 Views)

How To Create Login And Registration Forms With Session Handling Using Firebase / Help Needed To Get A Scammer / Urgent Help Needed On How To Save Fingerprint To Sql Using U Are U 4500 And Java (2) (3) (4)

(1) (Reply) (Go Down)

Php File Handling Help Needed by IntrovertedGuru(m): 7:51am On Mar 30, 2019
Good morning programmers, I recently started learning how to code using php and I'd say I fell in love with the language after few minutes. However I need some help.
I still cannot understand how a database works with MySQL so I'm trying to work my way around something.
I want to create a simple user login and registration/ user management without making use of a database. That is to say, I want my code a particular file in my front to be modified each time a new user joins the site.

i.e, if a new user registers, a file named users.php is modified in my ftp and assigns values to the data that user entered during registration as follows

$username ="$_POST["username"]";
$password ="$_POST["password"]";
$email ="$_POST["email"]";

This is what I'm trying to achieve, during registration, variables are assigned to each users and the information is stored in a phone file called users.php
So instead of using a database, I'm actually storing their information inside a file in my ftp and when a user tries to login, they would be validated using the if statement. If a user with username seen tries to login, an if command would be executed to check if his username and password matches with the one stored in users.php



Can this be achieved?

Thanks
Re: Php File Handling Help Needed by resosdigital(m): 8:44am On Mar 30, 2019
Yes, you can parse the file and regex to check matches but why the choice against using a database?
IntrovertedGuru:
Good morning programmers, I recently started learning how to code using php and I'd say I fell in love with the language after few minutes. However I need some help.
I still cannot understand how a database works with MySQL so I'm trying to work my way around something.
I want to create a simple user login and registration/ user management without making use of a database. That is to say, I want my code a particular file in my front to be modified each time a new user joins the site.

i.e, if a new user registers, a file named users.php is modified in my ftp and assigns values to the data that user entered during registration as follows

$username ="$_POST["username"]";
$password ="$_POST["password"]";
$email ="$_POST["email"]";

This is what I'm trying to achieve, during registration, variables are assigned to each users and the information is stored in a phone file called users.php
So instead of using a database, I'm actually storing their information inside a file in my ftp and when a user tries to login, they would be validated using the if statement. If a user with username seen tries to login, an if command would be executed to check if his username and password matches with the one stored in users.php



Can this be achieved?

Thanks
Re: Php File Handling Help Needed by IntrovertedGuru(m): 8:56am On Mar 30, 2019
resosdigital:
Yes, you can parse the file and regex to check matches but why the choice against using a database?
I just want to make something real quick plus I still don't understand how SQL works. How do I parse the file and check for matches?
Re: Php File Handling Help Needed by tactics: 8:59am On Mar 30, 2019
IntrovertedGuru:
Good morning programmers, I recently started learning how to code using php and I'd say I fell in love with the language after few minutes. However I need some help.
I still cannot understand how a database works with MySQL so I'm trying to work my way around something.
I want to create a simple user login and registration/ user management without making use of a database. That is to say, I want my code a particular file in my front to be modified each time a new user joins the site.

i.e, if a new user registers, a file named users.php is modified in my ftp and assigns values to the data that user entered during registration as follows

$username ="$_POST["username"]";
$password ="$_POST["password"]";
$email ="$_POST["email"]";

This is what I'm trying to achieve, during registration, variables are assigned to each users and the information is stored in a phone file called users.php
So instead of using a database, I'm actually storing their information inside a file in my ftp and when a user tries to login, they would be validated using the if statement. If a user with username seen tries to login, an if command would be executed to check if his username and password matches with the one stored in users.php



Can this be achieved?

Thanks

yes it can be achieved.

On the other hand, storing users data inside a file in cpanel is not advisable as the file can easily be compromised and it is not secure.

l will advice you to learn sql with php in order to handle user management and program as a whole. The best place to save data is in database and not file

If you still insist in your idea, l can write a code for you to save into file and validate users info from file.
Re: Php File Handling Help Needed by IntrovertedGuru(m): 9:12am On Mar 30, 2019
tactics:


yes it can be achieved.

On the other hand, storing users data inside a file in cpanel is not advisable as the file can easily be compromised and it is not secure.

l will advice you to learn sql with php in order to handle user management and program as a whole. The best place to save data is in database and not file

If you still insist in your idea, l can write a code for you to save into file and validate users info from file.
With time I'd learn SQL well.
I'd appreciate if you could write a code for me. Thanks for reaching out to me
Re: Php File Handling Help Needed by stanliwise(m): 11:22am On Mar 30, 2019
IntrovertedGuru:

With time I'd learn SQL well.
I'd appreciate if you could write a code for me. Thanks for reaching out to me
Have you gotten your problem solved or should I write the code?
Re: Php File Handling Help Needed by tactics: 11:36am On Mar 30, 2019
IntrovertedGuru:

With time I'd learn SQL well.
I'd appreciate if you could write a code for me. Thanks for reaching out to me

Hey, l can't paste the code here so l have written a short article for your. Check it out. Please let me know here if it solves your problem. Thanks

http://gistyet.com/how-to-create-register-and-login-with-file-validation
Re: Php File Handling Help Needed by kudaisi(m): 11:53am On Mar 30, 2019
searched google for "php login flat file" to save our time and they were so many examples.... [url] https://steemit.com/utopian-io/@akintunde/how-to-build-a-login-registration-system-in-php-using-a-flat-file-database[/url]
Re: Php File Handling Help Needed by IntrovertedGuru(m): 12:55pm On Mar 30, 2019
tactics:


Hey, l can't paste the code here so l have written a short article for your. Check it out. Please let me know here if it solves your problem. Thanks

http://gistyet.com/how-to-create-register-and-login-with-file-validation

Thanks let me run the code and get back to you.
Re: Php File Handling Help Needed by IntrovertedGuru(m): 1:14pm On Mar 30, 2019
tactics:


Hey, l can't paste the code here so l have written a short article for your. Check it out. Please let me know here if it solves your problem. Thanks

http://gistyet.com/how-to-create-register-and-login-with-file-validation

I ran the code. Registration was successful but when I login, the phone codes are displayed in text form
Re: Php File Handling Help Needed by IntrovertedGuru(m): 1:14pm On Mar 30, 2019
stanliwise:
Have you gotten your problem solved or should I write the code?
The problem is yet to be solved. I'd appreciate your help on the subject matter
Re: Php File Handling Help Needed by tactics: 1:24pm On Mar 30, 2019
IntrovertedGuru:

I ran the code. Registration was successful but when I login, the phone codes are displayed in text form

Can you post a screen of when you log in so that l can understand what you mean by "the phone codes are displayed in text form"
Re: Php File Handling Help Needed by IntrovertedGuru(m): 1:29pm On Mar 30, 2019
kudaisi:
searched google for "php login flat file" to save our time and they were so many examples.... [url] https://steemit.com/utopian-io/@akintunde/how-to-build-a-login-registration-system-in-php-using-a-flat-file-database[/url]
I ran this code tho it worked but the login isn't working. I'm getting user does not exist even when I use the correct username and password
Re: Php File Handling Help Needed by IntrovertedGuru(m): 1:29pm On Mar 30, 2019
tactics:


Can you post a screen of when you log in so that l can understand what you mean by "the phone codes are displayed in text form"
let me run the codes again sir
Re: Php File Handling Help Needed by tactics: 1:34pm On Mar 30, 2019
IntrovertedGuru:
let me run the codes again sir

Capitalization matters. If you register with Tacman as your username and you try to log in with tacman it will say username does not exist. So Make sure you have entered your username and password correctly with the same format you used to register
Re: Php File Handling Help Needed by IntrovertedGuru(m): 1:40pm On Mar 30, 2019
tactics:


Can you post a screen of when you log in so that l can understand what you mean by "the phone codes are displayed in text form"
It worked. My browser didn't load completely. Thanks.


Uhm, one more thing, I want to get some other details during registration like name, address, phone, etc

Then when the user successful logs in, I want to redirect them to a page let's say home.php where their details would be displayed.

Can you help me with that?
I'd also like to tweak the registration page so that successfully registered users would be directed to home.php.


Thanks for helping me
Re: Php File Handling Help Needed by tactics: 1:44pm On Mar 30, 2019
IntrovertedGuru:

It worked. My browser didn't load completely. Thanks.


Uhm, one more thing, I want to get some other details during registration like name, address, phone, etc

Then when the user successful logs in, I want to redirect them to a page let's say home.php where their details would be displayed.

Can you help me with that?
I'd also like to tweak the registration page so that successfully registered users would be directed to home.php.


Thanks for helping me


You are welcome.

Check the same site in the next 30 minutes from now. l should be done.
Re: Php File Handling Help Needed by IntrovertedGuru(m): 1:55pm On Mar 30, 2019
tactics:



You are welcome.

Check the same site in the next 30 minutes from now. l should be done.
Okay thanks. Just an innocent question..
Can I modify the users information from the site without having to do it from my ftp folder?
Re: Php File Handling Help Needed by tactics: 2:22pm On Mar 30, 2019
IntrovertedGuru:

Okay thanks. Just an innocent question..
Can I modify the users information from the site without having to do it from my ftp folder?

Yes you can. l want to upload it now. give me a second
Re: Php File Handling Help Needed by tactics: 2:59pm On Mar 30, 2019
You can check it now
Re: Php File Handling Help Needed by IntrovertedGuru(m): 3:13pm On Mar 30, 2019
tactics:
You can check it now
It worked perfectly sir. I can now tweak it to my taste.

I really appreciate sir.
I'd like to keep in touch with you in case I have further questions. I'd be glad if you can drop your contact details
Re: Php File Handling Help Needed by tactics: 3:22pm On Mar 30, 2019
IntrovertedGuru:

It worked perfectly sir. I can now tweak it to my taste.

I really appreciate sir.
I'd like to keep in touch with you in case I have further questions. I'd be glad if you can drop your contact details

You are welcome

Call/WhatsApp 08063000902
Re: Php File Handling Help Needed by stanliwise(m): 11:44pm On Mar 30, 2019
IntrovertedGuru:

It worked perfectly sir. I can now tweak it to my taste.

I really appreciate sir.
I'd like to keep in touch with you in case I have further questions. I'd be glad if you can drop your contact details
seem I came late.... i already created a tool for you to create new user, modify password, delete users, login users and get user details.
Read the readme.txt first

Find the zip
user_management.zip under this post

Re: Php File Handling Help Needed by IntrovertedGuru(m): 2:42am On Mar 31, 2019
stanliwise:
seem I came late.... i already created a tool for you to create new user, modify password, delete users, login users and get user details.
Read the readme.txt first

Find the zip
user_management.zip under this post
Thanks bro. But I recently started learning this and I don't understand how the tool works. Would be glad if you could break it down a bit.
Re: Php File Handling Help Needed by stanliwise(m): 6:48am On Mar 31, 2019
IntrovertedGuru:

Thanks bro. But I recently started learning this and I don't understand how the tool works. Would be glad if you could break it down a bit.
my contact is in the readme.txt
Re: Php File Handling Help Needed by singa4real: 2:43am On Apr 01, 2019
You can use json file as a data storageby keeping the file out of you public_html without the need for mysql database.

(1) (Reply)

Tips :How To Create An Online Student Result Checker App / How To Arrange School Broadsheet Sheet From Mysql Tables / Advantages Of Coding Your Own Website Rather Than Using Wordpress Or Wix

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 50
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.