Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __________MAIN_PAGE__________
- require 'general.php';
- function login(){
- $bCaptchaCorrect = checkCaptch($_POST['captchaInput']);
- if(!$bCaptchaCorrect){
- die("Captcha is wrong");
- }
- $sUser = $_POST['nameInput'];
- $sPass = $_POST['passInput'];
- $bLoginCorrect = false;
- /*
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- YOU WILL NOW ONLY BE HERE IF THE CAPTCHA WAS SUCCESSFUL
- Check username and password in database, using valuable CPU and memory resources.
- if everything works out then $bLoginCorrect = true;
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- */
- if($bLoginCorrect){
- /*
- Yey login!
- Go to to user section
- */
- }
- else{
- die("Username/Password is wrong");
- }
- }
- login();
- __________GENERAL_PAGE__________(general.php)
- $sCaptcha = getCurrentCaptcha();
- function checkCaptch(){
- if($_POST['captchaInput'] == $sCaptcha){
- /*
- Set all cookies/db entries/whatever to show captcha entered correctly.
- However you are doing it right now, no changes are needed.
- */
- return true;
- }
- else{
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement