|XP is just a number|
Using filepath method to identify an .html pageby Nik
|on Jan 22, 2013 at 15:10 UTC||Need Help??|
Nik has asked for the
wisdom of the Perl Monks concerning the following question:
What i want to do, is to associate a number to an html page's absolute path for to be able to use that number for my database relations instead of the BIG absolute path string.
so to get an integer out of a string i would just have to type:
htmlpage = a string respresenting the absolute path of the requested .html file
But would that be unique?
Here is some background information:
This counter script will work on a shared hosting enviroment, so absolutes paths are BIG and expected like this:
In addition to that my counter.py script maintains details in a database table that stores information for each and every webpage requested.
My 'visitors' database has 2 tables:
'pin' has to be a number because if i used the column 'page' instead, just imagine the database's capacity withholding detailed information for each and every .html requested by visitors!!!
So i really - really need to associate a (4-digit integer <=> htmlpage's absolute path)
Maybe it can be done by creating a MySQL association between the two columns, but i dont know how such a thing can be done(if it can).
So, that why i need to get a "unique" number out of a string. please help.