Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post

    Question Lock HTML code after specific time

    I'm a website designer in a small town. Its very hard here to convice people to launch their website. I recently got a project. The problem is my client is not paying me full amount, he's asking me to give him the site & after that he'll pay me. Tell me how can I lock the HTML code if he dont give me money??? in simple words.... I want a time lock which could stop working the site after a specific time(as we can do in VB). Please help me how can I apply a time lock on HTML pages???? should I use any JS or any server side ???

  • #2
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well server side would be the best... you could just run a function which shows the page if the time is before a certain date, or doesn't if it's after. Or you could just remove the pages from the server?

    Either way, whatever you put on the Internet, can, I'm afraid, be taken...

    I guess you could ask for half the amount now, half after; you and your client both need to build up trust with eachother. From his point of view, he doesn't know if you'll build the site or not.

  • #3
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post
    Actually he wants me to design his web free of cost
    I'm afraid that he'll not pay me full amount after getting the WEB
    Please give me any sample code that how can I solve my problem.
    Help me please !!!

  • #4
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Something like this... although my PHP isn't great, so you may want to experiment a bit first!

    <?php
    $today = mktime();
    $expires = mktime( 0, 0, 0, 09, 30, 2006);
    if ($today < $expires) {
    header("yourpage.html");
    } else {
    echo "Preview has expired.";
    }
    ?>

  • #5
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post
    Thank you very much for your help. Please give one more favor....
    When I use this code in HTML page it doesn't work & when I save the page as .php & try to open it prompts me to download the same php file. what should I do ???

  • #6
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,640
    Thanks
    0
    Thanked 649 Times in 639 Posts
    You need PHP installed on the server in order to be able to use it
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #7
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post
    I've downloaded PHP 5.1.6 but dont dont know how to install & where 2 install. can u please help me ???

  • #8
    Regular Coder googleit's Avatar
    Join Date
    Jul 2006
    Location
    birmingham, uk
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts
    do you own the webserver? because if not you cant install php you may have to fin different hosting

  • #9
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    If you want to run PHP on your local computer you also need a web server like Apache or IIS.
    OracleGuy

  • #10
    Regular Coder googleit's Avatar
    Join Date
    Jul 2006
    Location
    birmingham, uk
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmm this is easy to install and quite good too. download it here that is if you want to install it on your pc


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •