Perl & HTML

I know that a HTML file can be placed within a Perl page… But what I wondered… is there a way for the HTML from the Perl page to be placed in a new HTML page with tags
or the like? I have a script that writes directly to the index.htm with the above tags… and I thought it would be great to use it for all my html pages as it would keep the URL’s of photos and the like away from anyone viewing the source of my page. It “seems” to me to be an inexpensive way to protect against bandwidth theft. Thanks in advance for any help!


In order for a picture to be displayed, the browser has to retrieve the file - and in order to retrieve the file, the browser has to know the URL.

Is there a reason you expect a lot of bandwidth theft? The bandwidth allotments with the Dreamhost plans are pretty generous. If it’s necessary to worry about bandwidth theft, ensuring that the requests for JPG and GIF files have HTTP_REFERERs from your own site will eliminate most bandwidth theft.

yes there is a way to include perl file to your html page but first u need to change your page extension from .html to .shtml
then at the place where u want your perl file to show up, put this tag (just change the name and path to your document)

< !–#include virtual="/cgi-bin/yourfolder/nameofthefile.cgi"-- >

and thats about it

but that won’t protect against bandwidth theft because it’ll show the file source!

to protect your images try with some of anti-leech scripts they are kinda good… there is one I’m testing now at one of my domains which has large gallery and people simply Love to directly link to the pictures! its called Antileech and its made by im not sure if they still host that script…

You can also protect your page source code from viewing with just adding this simple code to your tag

< script language=“JavaScript” >
< !–
function click() {
if (event.button==2) {
alert(‘Sorry Access Denied’)
// – >< / script >

hope it helps


[quote]first u need to change your page extension from .html to .shtml


you can also set some options in .htaccess to parse all html pages for SSIs, or (better) use the xbithack to parse executable .html pages for SSIs. there’s some info on xbithack in the kbase.

Yep, and there’s more information at the Apache website, too:


Web Developer

[quote]You can also protect your page source code from
viewing with just adding this simple code to your



No, you can’t.

(Users can also click File/SaveAs if the page is not the result of a POST operation.)

right on! true, but its harder for someone to steal an image don’t u think? if they go through File/SaveAs, then they need to check out all the coding to find where’s that particular image…
~no right-click~ code is good for first aid… :wink: it doesn’t work with IE 6 tho!
there is one more line to add into tag to disable IE6 Image toolbar
< meta http-equiv=“imagetoolbar” content=“no” >

of course u can always use some “html encrypt/decrypt” software to really protect your source code
i was using one to “protect” some tutorials at my old site and it was alright…but… well its not a good solution if you have a lot of pages to mess up with encrypting and decrypting them every time when u need to update something… its really time-consuming And + it takes Ages for protected page to load!!!

a good software to protect images is Secure Image Pro = its not free though… but its cheap…


If all you want is the URLs of the images, there are lots of URL extractors around, too. For instance:

Over the past 30 years, I’ve noticed that the people who were the most concerned about copyright infringement were those who had the least to lose.

Not that I like it when someone steals my intellectual property - but it makes a whole lot more economic sense for me to concentrate on making more. Sites that are hard to use are sites that don’t get used.

Bob Wallace told me that shareware (and thus easy to steal) paid off for him, because he made more sales to people who otherwise would never have heard of his software than he lost to people who would otherwise have bought his software.

If you’re too young to know who Bob Wallace is, he was employee #7 at Microsoft, he wrote a Pascal compiler for them, and he was the author of PC-Write. He coined the very word “shareware”.

hi Deke…

you said:
"If all you want is the URLs of the images, there are lots of URL extractors around, too. For instance:

well a member here asked how to protect his/her images from other people linking directly to them… because of the bandwidth issue… and then i suggested using anti-leech script which will hide the exact url completely. And + anti-leech script disables sites like that one you promoted there! It simply cannot steal url of the protected picture!

I have tested that at my previous host and now i need to set it up again because i am hosting the artwork of other people and when artists are giving their artwork to someone to publish it online, they want to have some kind of protection… however, internet is not a safest place for Art… people like to download pictures … thus u can’t stop them and that’s kind of ok with me, But for artists, programs like Secure Image Pro are great solution!

at the other hand there are so many new or simply rude webmasters who like to hotlink the images and that way steal bandwidth… if u have A Lot of pictures at your site and they link to them and + if their site have alot of visitors… the bandwidth goes horribly high & ur the one who pays for that so there… hiding the image url can help in some cases… and in other cases as i said before anti leech software is a blessing…

You said:

“Over the past 30 years, I’ve noticed that the people who were the most concerned about copyright infringement were those who had the least to lose…”

From my humble experience, i have noticed that people who don’t appreciate other peoples work are either extremely rude or fools! For me, the most important thing is the Author and her/his Copyright Rights! And from that reason I’ll do what ever it takes to keep my site and their artwork at my site as safe as possible. im not there to judge the value of the artwork but to publish it so if they want to be protected im there to help them if i can…


In the Mozilla browser, you can see the URLs of all images in a page by using the “View / Page Info” function. And you can save each image from that screen. I don’t think there’s any way a site author can disable that with some silly JavaScript or meta tags.

– Dan

true but it makes things at least a bit harder for people to steal the pic…
I never said that js was perfect! God! It’s Far from perfect! but its kinda good feeling to know that they needed to spare at least one minute more to get that image than they expected. :wink:

Childish?.. mmm maybe… fun? More than just fun :slight_smile: it’s awesome Especially when they try to steal the image which is protected at some other way as well :wink:

In other words:
If you can’t beat them, you can make their lives miserable at least for one tiny moment :wink:

Better way still:

put this in an .htaccess file

Rewriteengine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !^
$ [NC]
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteRule .
.(gif|GIF|jpg|JPG)$ - [F]

zentao web design, graphic art and design at

zentao7, Gallery of Artists and Speculative Novel Writers Groups