Chapter 17: |
|
How to create a web page: Start with HTMLI'm using the echo() function to display the time and date on the page. The time may not be the same as your local time. That's because your web server might not be in the same time zone as you are. Suppose you're in the Eastern time zone and the server is in the Pacific time zone. The time shown on the page will be three hours earlier than your time. You can format the date and time in many different ways by using different options with the date() function. Refer to the following table for an explanation of each one. Notice that the "S" option is designed to be combined with month. In our example above, dS means show the day of the month with leading zeros (01, 02, 03,...) and show the ordinal suffix (1st, 2nd, 3rd, 4th...). |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
Automatic expiration date for an offer | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Suppose you want to give a person exactly 48 hours (or whatever time frame you choose) to respond to an offer. If they make their purchase by the deadline you could give them a reduced price or extra bonuses. First, you need to calculate the end of the deadline period. Here's how: <?php Once you've included the little PHP block above which determines the expiration date and time, you put your deadline notice into the sales page like this: This offer expires at <?php echo "$exp";?> EST. How does it work? The date() function determines the current time. Remember that the hour will depend on the timezone your server is in. Then the mktime() function calculates what the time will be exactly 48 hours from the time the page was displayed. You can set the value of $hours to be 24 hours, 72 hours or even several weeks later. Remember to be fair to all customers. Make sure that the deadline display shows the same time zone as the server so that the expiration will be exactly right. Want to calculate how many hours there are in "x" number of days? Here's the code I use: $number_of_days = "x"; Putting it all together and making it a function would look like this: <?php To calculate an expiration date or any other future date and time, just call your new expires() function and pass it a number of days (2, in this case) like this: $exp = expires(2); You could use this function for any number of things besides an offer expiration date. It could be used to show people exactly when their trial period or guarantee ends. Now you have a general-purpose expiration time and date generator. You just
set the desired number of days by changing the 2 in the call to the expires() function to the
number of days you want. The line to paste into your web page is still: Here's another cool thing to know. Since you have the exact date and time that the offer expires, you can put it into an email that you can send to a prospect. If you tease them with a freebie, you'll want to email it to them. That way you'll have their email address because they had to give it to you in order to get the freebie. Remind them about your offer and its expiration date in the message you send out. Don't forget to personalize the email message, too! What about enforcing the deadline strictly? It's possible to record the time the offer was made, along with an IP address, referring page, name, and email address in a database. If the prospect does decide to buy your product, you can check the database to see if they met the deadline. What you do with that info is up to you. |
| Previous Page Table of Contents Next Page |
Copyright © 2004 Steve Humphrey |