SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast ParfaitMacaron's Avatar
    Join Date
    Mar 2013
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP & MySQL/PHPMyAdmin

    I need to create a PHP register and login form for my website so that only those users using my system can log in after they've registered.

    Their details will be stored in a database which I have yet to set up.

    I am clueless with how to go about this, I have not used PHP at all. Do I need to identify the relationships/tables in my database first (MySQL/PHPMyAdmin) or can I build this register box and login box first?

    Can somebody please explain how to go about this?

    Thank you.

  2. #2
    SitePoint Member
    Join Date
    Mar 2013
    Location
    Manhattan, New York, United States
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well you can do it with many ways , the easiest is you can code your action php file which connects to the database stores or grabs data from database and accordingly perform register or login whatever you want . Well there is an another method in which you could do these tasks on the same page itself also using '$_GET' superglobal whenever someone clicks submit , it goes and do specified task and you are done .

  3. #3
    SitePoint Evangelist captainccs's Avatar
    Join Date
    Mar 2004
    Location
    Caracas, Venezuela
    Posts
    516
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If you have never coded php and are "clueless with how to go about this" you have taken on a fairly complex bit of scripting.

    You don't have to use a database, you could store the usernames and passwords in a file and that is a lot simpler. Don't store the passwords in the clear, use something like md5() to encode them.

    You do need to use sessions, preferably with cookies, to remember the user as he goes from page to page.

    The workflow is that at the top of the restricted page (pages) you ask if the visitor has logged in by checking a session variable. If yes, show the working page. If not, show the log in page. If he logs in properly you set the session variable accordingly.

    But it gets more complicated because the user should be able to change his password and to do so you should authenticate it by email.
    Denny Schlesinger
    web services

  4. #4
    Web development Company chrisranjana's Avatar
    Join Date
    Jan 2001
    Location
    chennai , tamil nadu , India
    Posts
    705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ParfaitMacaron View Post

    I am clueless with how to go about this, I have not used PHP at all. Do I need to identify the relationships/tables in my database first (MySQL/PHPMyAdmin) or can I build this register box and login box first?

    Can somebody please explain how to go about this?

    Thank you.

    Our very own sitepoint has a tutorial regarding php user registration (http://www.sitepoint.com/users-php-sessions-mysql/)
    Chris, Programmer/Developer,
    www.chrisranjana.com

  5. #5
    SitePoint Enthusiast ParfaitMacaron's Avatar
    Join Date
    Mar 2013
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the link! I was reading that earlier on this week.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •