Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
* * * * * 3 votes

Creating A Simple Yet Secured Login/registration With Php5

encryption registration login

  • Please log in to reply
113 replies to this topic

#13 QuickTrick

QuickTrick

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 11 July 2012 - 09:24 AM

Works great thanks
  • 0

#14 stripe

stripe

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Programming Language:PHP
  • Learning:PHP

Posted 27 August 2012 - 11:53 AM

Hi mate, I've tried your script and it works fine!
to bad you don't use sessions cuz this is what i was realy looking for.
i've made a site in php5 with multiple pages that have sql fed dropdown menu's that a user would be able to feed him/her self. Now i want to add an usersystem to this, so the same site is usable for multiple users. each having there own logins and db info i know how i wanna manage the db and site with the seperate user info. but the session stuff is completely new to me.

the way it is now is could make a verry simple insecure page reload in place of the welcome message and it would work for me.. but then theres the problem that other users could simply try a ton of other usernames to get into some one else's page.. 1 problem i realy dont want to have.

can you give me a nice pointer in the right direction how to make the sessions?
  • 0

#15 gerrybenny

gerrybenny

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Programming Language:C
  • Learning:C

Posted 28 August 2012 - 07:36 AM

I wanrt to include regural expression to the code. And an email. What should i do as am knew to coding.

Buy the way. Thanks for this code. And bringing oop to coding. But how can i include regural expression to this great code and an email.
  • 0

#16 papabear

papabear

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 472 posts
  • Location:DarkSide

Posted 26 September 2012 - 05:25 AM

I wanrt to include regural expression to the code. And an email. What should i do as am knew to coding.

Buy the way. Thanks for this code. And bringing oop to coding. But how can i include regural expression to this great code and an email.


you can use the function preg_match
here is the syntax

and here's an example use of it



<?php
// The "i" after the pattern delimiter indicates a case-insensitive search
if (preg_match("/php/i", "PHP is the web scripting language of choice.")) {
    echo "A match was found.";
} else {
    echo "A match was not found.";
}
?>

for more information about this function please go to http://php.net/manua....preg-match.php
  • 0
Life has no CTRL+Z
Never Forget To HIT "LIKE" If I Helped

#17 Galhetas

Galhetas

    CC Newcomer

  • Member
  • PipPip
  • 10 posts
  • Location:127.0.0.1
  • Programming Language:PHP

Posted 28 September 2012 - 01:41 AM

hy, nice tutorial, but its have a bug you can register the same user name how many times you want so you must to put it restrict when the user name is allready registed
  • 0

#18 papabear

papabear

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 472 posts
  • Location:DarkSide

Posted 28 September 2012 - 06:26 AM

hy, nice tutorial, but its have a bug you can register the same user name how many times you want so you must to put it restrict when the user name is allready registed


this is for illustration or tutorial purpose of making your POST values secured :)
I really did not put a rule about the username being unique.. it's up to the reader if he wants to improve everything :)
  • 0
Life has no CTRL+Z
Never Forget To HIT "LIKE" If I Helped

#19 metadome

metadome

    CC Lurker

  • New Member
  • Pip
  • 8 posts
  • Location:Denmark
  • Programming Language:PHP
  • Learning:C++, PHP, Ruby

Posted 30 October 2012 - 06:34 PM

Very nice tutorial, great reading stuff.
I'm new in OOP, but I'm playing around with your script.
  • 0

#20 papabear

papabear

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 472 posts
  • Location:DarkSide

Posted 31 October 2012 - 07:06 AM

Very nice tutorial, great reading stuff.
I'm new in OOP, but I'm playing around with your script.


It's good to know that people are enjoying my tutorials :) Good Luck into your programming career bro
  • 0
Life has no CTRL+Z
Never Forget To HIT "LIKE" If I Helped

#21 metadome

metadome

    CC Lurker

  • New Member
  • Pip
  • 8 posts
  • Location:Denmark
  • Programming Language:PHP
  • Learning:C++, PHP, Ruby

Posted 01 November 2012 - 01:05 AM

If some have problems with PDO driver, I can say you need to install php(53)-extensions and configure it with PDO driver for MySQL support.
I'm sitting behind a FreeBSD server, can't say if you need to do that in other systems, or how if so.
Just to mention it, if it could be helpful :)
  • 0

#22 aljosa

aljosa

    CC Lurker

  • New Member
  • Pip
  • 3 posts
  • Programming Language:PHP
  • Learning:PHP

Posted 12 November 2012 - 04:30 AM

Super tutorial papabear. Amazing learning example! I'm a PHP newbie and have one question regarding tutorial.
Why did you use composite primary keys in created table `users` PRIMARY KEY (`userID`,`username`) ?
  • 0

#23 Orjan

Orjan

    CC Mentor

  • Moderator
  • 2918 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#

Posted 12 November 2012 - 04:47 AM

Sounds unnecessary to me, but both fields should be indexed unique, but only userID needs to be in primary in my opinion.
  • 2

I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.


#24 papabear

papabear

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 472 posts
  • Location:DarkSide

Posted 12 November 2012 - 05:55 AM

Sounds unnecessary to me, but both fields should be indexed unique, but only userID needs to be in primary in my opinion.


yes, if following the database normalization userID must be the only primary key there... I haven't noticed that I also make the username primary key instead of making it a unique key, but this will work... my purpose is to have a unique username, I might have click the button in phpmyadmin wrong >_<
  • 0
Life has no CTRL+Z
Never Forget To HIT "LIKE" If I Helped





Also tagged with one or more of these keywords: encryption, registration, login