php - generate non linear urls
<blockquote>
  <p><strong>Update:</strong></p>
  
  <p>Ok.. I have read a lot of solutions...
  Thank you so much everybody. I think I
  will keep it simple and avoid the
  encryption and just rely on two fields
  matching in the database. I can keep
  the id as it is (sequential) but add
  for example a timestamp (with :
  removed). Then I can put both through
  the youtube style url generator...
  leaving me with a really short, unique
  and not easily guessed url. e.g</p>
  
  <p>before the youtube url gen blah.com?id=10345&amp;s=134025</p>
  
  <p>after blah.com?id=H2s&amp;s=tL2s</p>
  
  <p>I log the unique views to each id anyway...
  so I will record unsucessful ones too
  and if a user hits 10 non matching
  url's in an hour then I can block his
  ip (I know a proxy will evade
  this...but it makes it more
  difficult). </p>
  
  <p>What do you think?</p>
</blockquote>

<p>This may sound like a bit of an odd question... what I am looking to achieve is a way to generate an id to be used in a url which can not be guessed or calculated. What I mean is it is not id=1, id=2...</p>

<p>I was looking at a youtube style script <a href="http://stackoverflow.com/questions/1853471/php-help-improve-the-efficiency-of-this-youtube-style-url-generator">here</a>. Which has a padding option, but the padding is so obvious with urls like wTTTa and b666o. I considered MD5 ing the id... but thats hardly foolproof and makes for rather long urls.</p>

<p>The solution must be url based (can't be cookie or session based) and before you panic and think that I am trying to work out a way to secure my admin page - i am not, its part of a game I am developing.</p>
