Warning: main(/home/.lurky/jenni/star-girl.org/skins/cookiecheck.php) [function.main]: failed to open stream: No such file or directory in /home/jenni/star-girl.org/pages/tutorials/advanced/contestspasswords.php on line 1

Warning: main(/home/.lurky/jenni/star-girl.org/skins/cookiecheck.php) [function.main]: failed to open stream: No such file or directory in /home/jenni/star-girl.org/pages/tutorials/advanced/contestspasswords.php on line 1

Warning: main() [function.include]: Failed opening '/home/.lurky/jenni/star-girl.org/skins/cookiecheck.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/jenni/star-girl.org/pages/tutorials/advanced/contestspasswords.php on line 1

Warning: main() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/local/lib/php') in /home/jenni/star-girl.org/pages/tutorials/advanced/contestspasswords.php on line 2
Contests/Password Protection


Want to make some contests on your site like this one? This tutorial will show you how to do that. Or, if you like, use this code in the same way to password protect your page, and tell people to email you if they want the password or something.

1. Create a new page on your site called contestcorrect.html. This is the page your visitors will go to if they get the contest right (or type in the password). You need to put the award your visitors receive for guessing correctly, or if you're using it for password protection you could make it the splash page or index of your blog or something.
2. Copy this code and paste it into the page you just created:



3. When editing your code, make sure you don't accidentally delete any apostrophes (') etc. or it won't work. PASSWORD-HERE is where you put the answer to your contest - for example butterfly, or the password your visitors need to enter your site. Make sure it's not the real password for your site login! You must type it with no capitals or spaces and it should be one word only.
4. MESSAGE IF CORRECT needs to be replaced with what you want the grey box to say if your visitor gets the right word. You might want to put, 'Click to enter my site' or 'You got it right! Click OK for your award'. BOX-TEXT is what you want the question box to say, for example, 'Type the password (or your guess) here with no spaces or captial letters - remember it is only one word'.
5. Create a page called sorry.html and then put something like, 'Oops! You got it wrong! Click here to try again!', then save it and change the URL-IF-WRONG bit of the code to http://your-site.com/sorry.html
6. Save everything and view your page! It should now work :)
Warning: main() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/local/lib/php') in /home/jenni/star-girl.org/pages/tutorials/advanced/contestspasswords.php on line 28