View Full Version : Date (and time) Activated Self-Destruct Webpage

01-17-2003, 04:34 PM
I am attempting to create a time limited ‘evaluation’ website. It self-destructs (kind of) after a preview period.

I think in this post I both rambled a bit, and made myself unclear. You might do better to skip to the fourth post down (me again), where I re-explain myself, hopefully more effectively...

I wish to make use of JavaScript to fire a date and time activated page change, so that after a certain date the page would become unusable (to anyone with the right date). I have found some coding that would enable a different page *redirect* based on date, but I would specifically like to change something within the page itself.

The idea is to create a series of pages with the time-activated-change script in place. The site would then be ‘encrypted’ using a piece of web protection software, so that it is still *viewable*, but not *editable* by any normal mortal. The files would then be delivered to the potential ‘client’ but the pages would only work until the date specified in the script. After this date the pages would screw up in some way.

To give some specifics:

1) I’d really like the full code, and some dimbo-proof instructions. I’m not really much cop with JavaScript I’m afraid.
2) The change in the page should be activated at a certain day (1-31), month, year and hour, minutes. This date and time should be able to be set (fairly easily) within the code.

I have come up with some ideas as to how to mess up the page after the date has lapsed. Some of these ideas may be almost wholly unviable. I would like to avoid a script that requires widespread changes to existing tags/code within the page. If the script allowed a choice between a mess-up-function that looks ‘accidental’ and one that is a clear message that the site has expired that would be good. Very good even :)

This is starting to sound like I’m rambling. I do hope I’m not, and that you’re still with me.

Mess-up ideas:

1) The page constantly refreshes/forwards to itself each second so that it can never fully load (this sounds viable *to me*, and would be quite satisfactory. The other ideas are just fancier ;)
2) Omits all usual page content and instead displays a short HTML-formatted mini-page that explains the site has expired (the mini-page should be changeable, but coded within the main page. Eep!)
3) Paragraph and break tags become invalid (so it screws the formatting) (I’m guessing this is impossible without changing every tag, right?)
4) All text and the background of the page becomes white (I’d rather not use CSS to enable this though – if it means changing the main page)
5) All pictures ‘fail’ (ie. you get the nasty red cross – though this wouldn’t be any good if they could just move the images to a different folder to make the site functional again)
6) Perhaps a little evil but I know there’s a script about that makes a computer crash if you right click on the page. An adaptation could be employed to crash the computer as soon as the expired site was loaded. I don’t know; maybe that’s too harsh. :P

Well, there we go. That’s about it. I think it’s quite a nice idea, but to someone with as little idea of coding as me, quite boggling.

That’s it. I’ll be interested to see what you guys make of it. Cheers :D


*baited breath*

01-17-2003, 04:50 PM
What are you trying to achieve with that? Sounds like a very annoying version of a shareware-website that's hardly worth the trouble. What if your "potential client" has JavaScript disabled? What if he knows of "view->source"? I say: Don't hope to much.

And asking for code that deliberately crashes computer is ... umh, harsh is the wrong word for it. You are aware that this request might bring you to court, do you?

01-17-2003, 05:20 PM
You would almost have to force the users to register (using a server side language and database) so you could track how long they have used the site.

With javascript your only choice would be to use cookies and assume the person is using the same computer and has never cleared his or her cookies.

As far as locking up the page, this script stop them from being able to do anything (until they get smart and disable javascript of course)

<script language="javascript">
function expired(){
alert('this site has expired');
<body onload="expired()">

There might be an easy way to get around it, but it will stop inexperienced users. I don't know if there is an easy way to close it, so you might consider this malicious and your users might lynch you.

01-17-2003, 05:59 PM
Oh dear. I think I must have explained myself rather badly. Sorry. :(

The idea of the script is this:

1) client requests website be made for them.
2) you create website (including the ‘self-destruct’ script).
3) you pass the site through a program which scrambles the code unintelligibly to the human eye but which still works on a web browser ( I think it’s called Web Protector or something).
4) you give the website to your client, on CD, for approval, explaining that it is a time limited website and that they must come back to you and pay you should they wish to use it publicly. You will then give them a ‘clean’ version of the site.
5) if they are dishonest and try to upload your site without coming back to you and paying you for the design work, the website will shortly stop functioning.

In its most basic form all the script really needs to do it this:

Prior to the cut-off date the script does nothing. After the date/time specified in the script the page will automatically forward to itself every one second; thus rendering the website useless. (Remember they can’t change the date and re-upload the site because the site code is scrambled from the protection program).

It’s not a script which is intended to muck about normal visitors to a normal website. It’s to prevent unauthorised long-term use by a company of a ‘preview copy’ website designed specifically for that client.

Visitors *could* theoretically disable JavaScript but that doesn’t matter: what professional website would want visitors to have to faff like that in order to have to use it. If it makes their site messy, it’s enough to stop them using an unauthorised version.

I’d not go on Google if I had to change my internet settings for it.

I suppose it’s the website designers equivalent of a 30 day trial. Try it; if you like it, pay me. If you don’t pay me, the product will stop functioning after 30 days anyway.

In one line (of nonsense code):

if date = “> desired_cut_off_date” forward(1)=”self.html”

I hope that’s a bit clearer.

Any help appreciated – and if you have any questions don’t hesitate. I’m not some kind of over zealous pay-porno-website-provider. :D



01-17-2003, 06:25 PM
To scare off an untrustworthy customer you can make use of this:

var day = 1;
var month = 1;
var year = 2003;

var expire = new Date(year, month - 1, day);
var now = new Date();

if (now > expire) {
location.href = location.href;

day stands for the day the script stops working, month for... you get the idea. The page redirects to itself in this case (that's what is in the if-statement, you can adjust that to other nasty things you can think of).

I still think it's not great protection and probably easy to spot in scrambled code. Just think of the plentiful of cracks that exist for shareware programs.

Wouldn't a better relationship with the customer make such things unnecessary? I know there always some bad clients out there, but another route of protection you could investigate into is copyright. Print the layout of your site, but it in an envelope, and send it to a post box and let it lie there. Some days after that, you hand the customer the cd. And if they tell you "no thanks" and reuse your layout on their site, you can dug out your envelope of the box, phone your lawyer and set up a nice letter to bad clients. Of course that only works if you design sites for the internet.

01-17-2003, 07:36 PM
Keep in mind, however, that none of these solutions will stop a determined customer to use your design, as you only need some javascript knowledgements and a search in google to find how to unscramble the code, remove the "self destruction script" and use the site without problem.

01-18-2003, 01:21 AM
What borgtex said... you can't protect the design, really (or anything client-side, for that matter) - but you can prove when the files YOU have were created and compare them to the STOLEN files if it came to that, and that should be enough to stand up in court (I would hope).

Better yet, is to have a dynamically generated site using databases, etc.

I'd like to see someone without the database/server-side experience try to steal that kind of functionality (not just design). It would be more than worth their time in that case to pay you for it - because if they already had that kind of knowledge, then they wouldn't need that kind of expertise in the first place. :)

01-18-2003, 08:46 PM
Perfect clients are brilliant, but they aren’t always that easy to find. They’re a bit like decent JavaScript sites and groovy coders; once you’ve found one – hurrah!

Thanks therefore to mordred for providing exactly what I wanted. A fairly low-tech solution to enforce a straight-forward time restriction. It’s certainly not ‘unbreakable’ but to a small client with little idea of website languages it’ll be plenty and services exactly the need I have (well, HAD).

Cheers guys. You’re all very groovy.


*macho hugs*

01-19-2003, 02:50 AM
that should be enough to stand up in court (I would hope).
'cept ya know wha??? probbbably by the time ya just a got® thru the court process??? the onlyyy one to just a recover® the $$$ twould be the lawyer...:O(((

I'd like to see someone without the database/server-side experience
/me is just a sooo® glad that /me knows n' can just a bug® someone whooo HAAASSS the experience...lol...you know...the kind ya just a bakescookiesfor® ...rotflmao...

if they already had that kind of knowledge, then they wouldn't need that kind of expertise in the first place. :)
welll.../me doesnt mind just a baking® cookies nor sending $$$ hehehe...

/me tends to just a send® them just a printed® 'copy' orrr just a image® in 400x400...

01-19-2003, 03:30 PM
Just a little update for those that might interested.

I've been playing around with this a bit. I rather think I'm having more fun making unusable websites than normal ones :)

Anyway, the variants I've cobbled together from my little code collection so far include:

After lapse date...

a) the background turns the same colour as the majority of the text on the page
b) the page does that 'earthquake thing'
c) the page background flashes an alert colour
d) the page pops up an alert and then sends the user back to their previous page

With the assistance of people elsewhere on the forum I'm now working on a variant that pops the alert and sends them back one page IF they've come from somewhere else, but would flash the background if they went directly to the page in a fresh browser window.

Cheers again guys for your help on this little project. I *never* thought I'd find a use for that earthquake script :D


PS: Of course, I don't really anticipate ever having to use these things. But they're raher fun to make. You should have a go ;)

01-16-2014, 06:24 AM

Did you ever get this code working? I need one for a landing page.