Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: From php to perl + template solution

by Nik (Initiate)
on Jul 13, 2010 at 16:26 UTC ( [id://849313]=note: print w/replies, xml ) Need Help??


in reply to Re: From php to perl + template solution
in thread From php to perl + template solution

Thanks. Can't i just use mod_rewrite telling the webserver NOT TO run html pages the user clicks because these are my actual templates waiting to be rendered and instead redirect those requests to index.pl script to calculate the counter data, render the tempalte and display it?
  • Comment on Re^2: From php to perl + template solution

Replies are listed 'Best First'.
Re^3: From php to perl + template solution
by scorpio17 (Canon) on Jul 13, 2010 at 20:34 UTC

    I was thinking of something like this:

    URL a user enters:

    http://your_server/page1.html
    

    mod_perl maps this into:

    http://your_server/cgi-bin/myscript.pl?temp=page1.html
    

    or even:

    http://your_server/cgi-bin/myscript.pl/page1
    

    (this is how it will look if you use CGI::Application. I suggest get this working first, then add a .htaccess file in your cgi-bin directory to add the mod_perl mod_rewrite stuff afterwords.)

    The script reads in template "page1.html", figures out the counter value, inserts it, and displays the page.

    All the template files should be in a special directory, not under the document root, so there's no way a user can point their browser to the "real" page1.html.

    update: corrected typo

    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-18 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found