Xdega Posted September 30, 2010 Share Posted September 30, 2010 I have a project and what I am trying to achieve here is a login system that can operate similar to Myspace (but way less advanced). I am quite a novice when it comes to PHP/SQL but I want to have a game plan before I really get working on this project. Basically my idea at the moment is to try and create a simple login system (that part should not be too difficult). By this a user can login and edit database entries associated with their username. I am pretty confident I can get this first part figured out. My problem comes with the second part: To create a page for a user that registers an account such as "www.websiteurl/[uSERNAME]" My initial idea is to try and pull a variable from [uSERNAME] and use it in the page script to pull data from the database based on that variable. I understand SQL Injection security risks involved and that the variable would have to be clarified as having nothing but a simple text string. But the main thing, Is this possible? if so How? OR If this is not possible, How could I go about creating this "profile page" for a registered user? Bearing in mind this does not to be super advanced (in fact the simpler the better). Simply the ability for a user to post text information to several fields,"update" their profile, and then access the data in read only form via their own personal url. I don't want to have to manually create pages/folders. That kinda defeats the purpose, heh. Thanks for your help in advance. Quote Link to comment https://forums.phpfreaks.com/topic/214803-help-with-login-systempersonal-page/ Share on other sites More sharing options...
the182guy Posted September 30, 2010 Share Posted September 30, 2010 The /username part is simple, you can do that with a mod_rewrite rule in your htaccess - there are loads of examples online. The rewrite rule will pass whatever the username is as a variable into your chosen script. You can then clean the username and check the db to see if there is a username that matches, if it matches then load the profile details. Quote Link to comment https://forums.phpfreaks.com/topic/214803-help-with-login-systempersonal-page/#findComment-1117496 Share on other sites More sharing options...
Xdega Posted September 30, 2010 Author Share Posted September 30, 2010 Thank you very much for that clarification. Apologies for probably posting this in the wrong section. Quote Link to comment https://forums.phpfreaks.com/topic/214803-help-with-login-systempersonal-page/#findComment-1117728 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.