General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old August 3rd, 2002, 10:34 PM
suzila suzila is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 5 suzila User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
session_id

my projects is about build a questionnaire,
when user put their quetionnaire data, so i must ive them an unique id..'
how could i give them the id without using session_id.
i like to give an unique id with only number..not '13d4e68'

because, when i'm using session id..i wil return a warning...

Reply With Quote
  #2  
Old August 4th, 2002, 01:27 AM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to Lindset Send a message via AIM to Lindset
You could use the mt_srand() and mt_rand() function for creating the user id itself. If you have access to a database you can use the auto_increment option on a column, which will generate unique id's (it gets incremented, right)

PHP Code:
<?php

mt_srand
((double)microtime()*1000000);
$num mt_rand(11000000000);    

echo 
$num;

?>


That code above should generate pretty random numbers. I have set up a page where you can test changing the max value of the mt_rand() function. It puts 10 000 values using the mt_rand() function in an array, and then removes the duplicates. It lets you see how many duplicates there are.

http://kbase.webpixels.net/randomnumber.php

Uh, I think that's all I had to say..
__________________
Best Regards,
Håvard Lindset

Last edited by Lindset : August 4th, 2002 at 01:31 AM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > session_id


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway