Well guys
I need a way to get an unique id using php. For the moment, I have learned that the best way to get an unique ID is to put together time() and server address. Then, for additional security we can use additional strings, sha1, md5, etc.
Problem, the result that I got is quite long. Is it possible to get something that is short, but unique and secured at the same time?
Thanks. :)
4 1815 Markus 6,050
Recognized Expert Expert
have you tried using rand()?
Thanks mark. But what would be the possibility for two person to get the same number, using rand() only. It seems that there's a danger, isn't it?
OK, I am doing it with rand() + mysql_insert_id . :)
Thanks Mark.
Markus 6,050
Recognized Expert Expert
Thanks mark. But what would be the possibility for two person to get the same number, using rand() only. It seems that there's a danger, isn't it?
It is.. but only a little chance that would happen.
And just to make sure that it wasn't a duplicate you could compare the id against the ones already in the db and if there's a match you could create a new one.
OK, I am doing it with rand() + mysql_insert_id . :)
Thanks Mark.
No probs :)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: August1 |
last post by:
A handful of articles have been posted requesting information on how
to use these functions in addition to the time() function as the seed
to generate unique groups (sets) of numbers - each group consisting of
6 numbers - with a total of 50 groups of numbers.
A well-known girl that some publishing companies use to provide
introductory level textbooks to various Junior Colleges in the U.S.,
not surprisngly, asks for this same exact...
|
by: Mike MacSween |
last post by:
Yes, I've downloaded and read the FAQ. And searched the archives. I'm just
treading a little carefully here because of the caveats about locking myself
out of the db forever. Some answers I could probably get myself just by
trying things out. But don't want to 'play' around too much.
I ran the Security Wizard on my system at my office. Did all the usual
things, admin -> users, users group have no rights. Assigned rights as
required. The...
|
by: James |
last post by:
I have a VB windows forms application that accesses a Microsoft Access
database that has been secured using user-level security. The
application is being deployed using No-Touch deployment. The objective
in utilizing this new deployment method is to reduce the maintenance
overhead as well as making it easier for my users to setup and run the
application initially. I have VS 2002, Windows XP, Access XP(2000
format).
He is my problem....
|
by: James |
last post by:
I have a VB windows forms application that accesses a Microsoft Access
database that has been secured using user-level security. The
application is being deployed using No-Touch deployment. The objective
in utilizing this new deployment method is to reduce the maintenance
overhead as well as making it easier for my users to setup and run the
application initially. I have VS 2002, Windows XP, Access XP(2000
format).
He is my problem....
|
by: Chris Dunaway |
last post by:
I have a web service which is accessed by a windows forms application.
When the application submits a unit of work (a "job"), I want to return a
job receipt or tracking number back to the application.
My requirements are these:
1. The receipt number must be unique (like a guid is unique)
2. The receipt must be NON sequential.
3. If possible, I'd like it to be 10 to 12 characters long.
4. If possible, I'd like to include only...
| |
by: Daniel Frechette |
last post by:
Hi,
Is it possible to have secured (SSL/HTTPS) and non-secured (HTTP)
content in the same page without breaking the security? I am developing
a secured reservation system in which the user can access Google Maps
(not secured). The map is embedded in the page and does not open in a
separate window.
What solution do you recommend? Use iframes? If so, how?
|
by: trihanhcie |
last post by:
Hi,
I have a <img src = "http:// ..."> which needs to be put in a secured
page. For example on amazon when the confirmation page is displayed...
The problem is that it's a secured page (https) and my tag is an
absolute path... It looks like it's the problem because the tag is not
secured. What are the possible solution to display the image without
the warning message?
Thanks
|
by: securedcardss |
last post by:
http://card.2youtop.info
secured credit card
card
credit instant secured
card cash
credit secured
card
|
by: Anton |
last post by:
Hi,
when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in
a browser and entering the username and password manually, the wsdl is returned. So the username and password should
be ok.
I'm using this code:
Merchant myMerch = new Merchant();
myMerch.merchantIdentifier=merchantId;
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| | |