Hi!
I'm new here, I have been stuck on this for about to weeks. I am trying to replicate something like the humble bundle's website, where they give you a url like http://humblebundle.com/?key=hj2qg4j2h34234 and you can access the page. I have tried for about 2 weeks but can't figure it out, I know it uses mysql, has anyone seen a script for something like this? Or can anyone give me some code that does this please?
Thanks,
_8Bit
_8Bit
0
Newbie Poster
Recommended Answers
Jump to PostSo what do you need?
Jump to Postfunction randomHash($length) { if (!$length) $length = 6; $array = array_merge(range('A', 'Z'), range('a', 'z'), range(0, 9)); for($i=0; $i<$length; $i++) { $random = mt_rand(0, count($array)-1); $random_hash .= $array[$random]; } return $random_hash; }
This creates a random hash with the length of $length.
Add it to your database …
Jump to PostThere are different ways to do it...
one of these are:-
1. Use a database and in that map it according to the value ,then convert it using some encrption like md5,sha1(Manual about …
Jump to Post$sql = 'INSERT INTO table (key) VALUES ("'.$key.'")'; $result = mysql_query($sql);
$sql = 'SELECT key FROM table'; $result = mysql_query($sql);
All 14 Replies
MagicMedia
10
Junior Poster
_8Bit
0
Newbie Poster
minitauros
151
Junior Poster
Featured Poster
_8Bit
0
Newbie Poster
IIM
163
Master Poster
_8Bit
0
Newbie Poster
MagicMedia
10
Junior Poster
rv1990
6
Junior Poster in Training
_8Bit
0
Newbie Poster
_8Bit
0
Newbie Poster
_8Bit
0
Newbie Poster
_8Bit
0
Newbie Poster
_8Bit
0
Newbie Poster
Ichcha
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.