Posted by Toby Inkster on 01/04/07 14:58
Tom wrote:
> I'm not too fond of having the unencrypted integer sitting right there in
> all hashes :-D
What's wrong with having the unencrypted integer there? As long as you
make sure you *check* the hashes (which code2int does!), then you're safe.
<?php
// listing.php
require 'coding_stuff.php';
print "<ul>\n";
for ($i=1; $i<=10; $i++)
{
$c = int2code($i);
print "<li><a href=\"view.php?number={$c}\">view {$i}</a>\n";
}
print "</ul>\n";
?>
<?php
// view.php
require 'coding_stuff.php';
$c = $_GET['number'];
$i = code2int($c);
if ($i!==FALSE)
{
// show the image here.
}
?>
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|