Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,166,674 members, 7,865,707 topics. Date: Thursday, 20 June 2024 at 12:39 AM |
Nairaland Forum / Science/Technology / Programming / Php File Handling Help Needed (2108 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)
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: |
Re: Php File Handling Help Needed by IntrovertedGuru(m): 8:56am On Mar 30, 2019 |
resosdigital: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: 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: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: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: 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: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: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: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: 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: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:let me run the codes again sir |
Re: Php File Handling Help Needed by tactics: 1:34pm On Mar 30, 2019 |
IntrovertedGuru: 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: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: 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: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: 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: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: You are welcome Call/WhatsApp 08063000902 |
Re: Php File Handling Help Needed by stanliwise(m): 11:44pm On Mar 30, 2019 |
IntrovertedGuru: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: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: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)
Between computer science and software engineering / New Cool: Javascript Css Selector "yapinator" Faster Than Sizzle: Peppy: Etc / Bincom Academy 95% Scholarship For PHP/MYSQL Training January Session
(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. 44 |