Lost Password?


  #1 (permalink)  
Old 03-22-2007, 10:45 PM
Jaan's Avatar   
Jaan Jaan is offline
Mod
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 930
Last Blog:
AdStar Ad Control Pa...
Rep Power: 16
Jaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the rough
Send a message via MSN to Jaan
Default Unique ID

Sometimes you need to create a unique id for something.. i'll show you one really easy way how to create a unique id:

PHP Code:
<?php
echo uniqid(); // This will create a ID what is 13 characters long
?>
Example

PHP Code:
<?php
echo uniqid(''true); // This will create a ID what is 23 characters long
?>
Example
__________________


Cheap & Professional Web Design | Need help? Send a PM
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 03-23-2007, 03:40 AM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

What is each parameter responsible for? Meaning what happens if i change true to false? and what can i put in the ' ' ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-23-2007, 08:06 AM
Jaan's Avatar   
Jaan Jaan is offline
Mod
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 930
Last Blog:
AdStar Ad Control Pa...
Rep Power: 16
Jaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the rough
Send a message via MSN to Jaan
Default

uniqid syntax is:

Code:
uniqid(string prefix, [bool_more_entropy])
so.. if you use this:

PHP Code:
<?php
echo uniqid(''true); // This will create a ID what is 23 characters long
?>
then you can write your ID prefix into ' '.

Example:

PHP Code:
<?php
echo uniqid('codecall'true);
?>
This will create a unique id what looks like this:
Check
Like you see there's prefix+id so there have to be codecall(idHere)

Now those true and false statements

If you use false statement then your id will be 13 characters long, but if you use true statements then this id will be 23 characters long
__________________


Cheap & Professional Web Design | Need help? Send a PM
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript: Prime or not reachpradeep Javascript 4 08-23-2007 09:58 AM
text file manipulations in vb6.0 Ronin_paes Visual Basic Programming 3 06-11-2007 05:54 AM
Storing a Secure Password dirkfirst PHP Forum 7 07-22-2006 11:45 PM


All times are GMT -5. The time now is 07:31 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 97%

Ads