First off, check out URL below. You'll learn how to make that today. http://www.jumpx.com utorials/3/signup.html
Fill out your e-mail address on page you see. (I promise it's not being saved anywhere.) Then, wait a minute or two and check your mail. You should get a message from Gumby (null@jumpx.com) containing a sample autoresponder message.
Today, we're going to learn three easy things: redirection, mail sending, and form submission.
When we finish with that, you will know how to put those components together and create an autoresponder. Because if you think about it, that's all an autoresponder does. Somebody enters in their e-mail address, are sent an e-mail message, and then are redirected to a new page.
Of course there are more complex autoresponders, like Gary Ambrose's Opt-In Lightning, or Wes Baylock's Mail Master Pro which handle multiple follow-ups and record e-mail addresses of those who have signed up for responder. But today we're just going to focus on how to make a very basic, very simple autoresponder.
Hopefully, you've seen what form objects in HTML look like. Here's some code you can use for an example:
Password Protection and File Inclusion With PHP
Written by Robert Plank
First off, if you read last week's article by me (the one about site personalization in PHP), I have one addition to make to make your life a little easier. If you didn't read last week's article, read it. It'll help you. You can find it here: http://jumpx.com utorials/1
Now, remember how we personalized a page for your visitor? This works fine, but what do we do if they didn't use that special link, and just went to page?
What I'm saying is, if you special personalized page was at http://www.your.host/sales.php/f=Oscar/l=Grouch but your visitor only went to http://www.your.host/sales.php. Instead of name there would just be a blank spot! Last week I forgot to cover this.
All we have to do to fix it is to tell PHP that if they didn't leave a name, to substitute one in for them. So let's say that if they left their first name blank to make their first name "Friend". This way instead of saying "Dear Oscar:" it would say "Dear Friend:".
Put following line of code JUST ABOVE THE LINE that says something similar to: echo "$f $l" :
if ($f == "") { $f = "Friend"; }
That way, you can use your special personalized page as a normal page and no one will be wiser.
Password protection is something you need every once in a while. Whether it's a secret site you're running or just control panel of your favorite script.
Sometimes you don't need a fancy solution like .htaccess if you're only worrying about a single user (you). But JavaScript passwords can be worked around, and HTML-based passwords based on cookies, written in PHP are complicated and take time to write. Htaccess is nice but it's a pain if you just want to use it for one person.
Here is a simple way to use HTTP authentication (the same you see used by htaccess) with just a few lines of code. Below are sample contents of a file you can use.
Last week we learned that PHP code can be integrated into your HTML. All you have to do is make sure file ends in .php (for example, "firehydrant.php") and it will work. Everything that comes in between this:
/* And this: */
?>
Is treated as PHP code. Everything outside of those tags is treated as plain HTML.
When copying this code over be SURE to include that last line where it says "my main text." Note that "my main text" is located outside of PHP code brackets. This means that where you see "my main text" can be your normal HTML file!
Take all of this code and Upload script onto your web server and run it in browser. You should be greeted by a password popup box similar to those you see with htaccess. Enter "myusername" as username and "mypassword" as password. You should be given a page that says "my main text" and nothing else.
Close your browser window (this is very important) and going back to that page. Try entering wrong info. The box will come up again. You have three tries and then are given that dreadful "Authorization Required" message.