Thought it might be useful to add a small amount of PHP to one of my Links SQL templates, in order to log the IP address of visitors. I didn't use the PHP template system because I understand that it's not complete yet.
So I simply changed the default build extension from html to php, and added a <? couple of lines of code ?> to the template.
In static mode it works just fine. But in dynamic mode, the PHP code doesn't get passed through apache so it's visible to anyone who does a View Source in their web browser. Complete with all the passwords for connecting to your database.
Be warned!
I fixed it by disabling dynamic mode. Which I did by replacing page.cgi with a file that generates the necessary html for redirecting to the static site. Not ideal, but it'll do for now. I don't want my users using dynamic mode anyway, for performance reasons, but it's worrying if they can surf to page.cgi and see my PHP source code.
Rob.
So I simply changed the default build extension from html to php, and added a <? couple of lines of code ?> to the template.
In static mode it works just fine. But in dynamic mode, the PHP code doesn't get passed through apache so it's visible to anyone who does a View Source in their web browser. Complete with all the passwords for connecting to your database.
Be warned!
I fixed it by disabling dynamic mode. Which I did by replacing page.cgi with a file that generates the necessary html for redirecting to the static site. Not ideal, but it'll do for now. I don't want my users using dynamic mode anyway, for performance reasons, but it's worrying if they can surf to page.cgi and see my PHP source code.
Rob.