You are here: Re: Integer to code and back « PHP Programming Language « IT news, forums, messages
Re: Integer to code and back

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация