Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Using filepath method to identify an .html page

by Corion (Pope)
on Jan 22, 2013 at 15:28 UTC ( #1014697=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Using filepath method to identify an .html page
in thread Using filepath method to identify an .html page

Why don't you create a database table with two columns. One column is "the string", and the other column is a unique integer. Most databases have an almost inexhaustible supply of unique integers for such columns.


Comment on Re^3: Using filepath method to identify an .html page
Replies are listed 'Best First'.
Re^4: Using filepath method to identify an .html page
by Nik on Jan 22, 2013 at 15:48 UTC
    Integers need to be created on the fly when an html file is being requested.
    I just tried:
    pin = int( htmlpage.encode("hex"), 16 )
    but that also fails.

    The number needs to be a 4-digit integer only, if its to be stored in the database table correctly. So hex encoding is not usefull here.

      I did not mention a "hex encoding" anywhere in my reply. I suggest you actually read my reply, and use a database, or a "key value store", and build a map of words to numbers.

        No...no that would be complex.
        I just need a way to CONVERT a string(absolute path) to a 4-digit unique number with INT!!! That's all i want!! But i cannot make it work :(

        And the best part is that "that" number must be able to turn back into a path.

        This way i DON'T EVEN HAVE TO STORE THE ACTUAL HTML PAGE'S ABSOLUTE PATH!!!!

        1. User requests a specific html page( .htaccess gives my script the absolute path for that .html page)
        2. I turn the path into a 4-digitnumber
        3. i store that number to the database. I DONT EVEN HAVE TO STORE THE PATH TO THE DATABASE ANYMORE!!! this is just great!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014697]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (20)
As of 2015-07-28 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (255 votes), past polls