Logo 
Search:

PHP Forum

Ask Question   UnAnswered
Home » Forum » PHP       RSS Feeds

Username & password code

  Asked By: Ronnie    Date: Nov 04    Category: PHP    Views: 2241
  

I been working with my project for 2 days i need your help on how to
create username and password using php for newbies...

i need a code simple code which is easy to understand

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Walborgd Fischer     Answered On: Nov 04

First you can get random numbers and using md5 or any other encryption.

now you can get 40 or 36 char string. The string contains small, capital letters
and numeric values.

Use sub string pre-defined function, get the values based on your requirement.

<?php
$username = substr( md5(rand(100, 1000), 6, 8);

?>

6 -> it is the starting index value.
8 -> Total number Charectors for seeking from stating index value.

This is simple  way to generate random password, Hope use this one and generate
password with complicated.

 
Didn't find what you were looking for? Find more on Username & password code Or get search suggestion and latest updates.




Tagged: