Jump to content

Creating random number


ZeroShade

Recommended Posts

Uh... why?Anyway, you can just do it at the top of your page

$rand = rand(0, 100); //rand takes the range (min and max ) of the random numbermysql_query("INSERT INTO table (randomnum_field) VALUES ($rand)");

Link to comment
Share on other sites

For security reasons, maybe?E.g.* Generate random number, store to $rand* Store it to database* Include non-hotlinking page* Inside non-hotlinking page: -- Get random number $rand -- Retrieve most recent random number from db -- If $rand != random number from db then die(hotlink attempt) -- Else continue with execution* EndThat is one application I could think of...

Link to comment
Share on other sites

Hot link is a direct link to a file, so say if you had a file include.php, which was included in other files, but then if someone accessed it directly that would be hotlinking. Many hosts have provisions against image hotlinking due to bandwidth costs.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...