CKAP Welcome sharing the embedded excitement
New user?
 
  EOD; //end-------------------------------------------------html registration body one---------------------------------------- //start-----------------------------------------------html registration body two--------------------------------------- $html_body_two = <<
 
 
 
 
 
Copyright © 2010 www.ckap.in
Personal website - C. K. Anantha Prasad
EOD; //end-------------------------------------------------html registration body two---------------------------------------- //start-------------------------------------------------html registration form---------------------------------------- $html_reg_form = <<

Registration form

 

Email
Name
Password
Re-type Password
Address
City/Town
Country
Mobile no.
Anti Spam Protection CAPTCHA Image


EOD; //end-------------------------------------------------html registration form---------------------------------------- //start-----------------------------------------------html registration thanks--------------------------------------- $html_reg_thanks = <<

Registration Successful

Thanks for registering with ckap.in!

Please check your email, an activation code has been sent for authorizing your account. Once the authorization process is completed you can login to ckap.in

EOD; //end-------------------------------------------------html registration thanks---------------------------------------- include("dbconfig.php"); session_start(); // mainly session started for securimage - CAPTCHA include("securimage/securimage.php"); //Input vaildation and the dbase code if ( $_GET["op"] == "reg" ) { $securimage = new Securimage(); if ($securimage->check($_POST['captcha_code']) == false) { echo "
Sorry, the Anti spam code you entered was wrong Go back and try again.
"; die (""); } $bInputFlag = false; foreach ( $_POST as $field ) { if ($field == "") { $bInputFlag = false; } else { $bInputFlag = true; } } // If we had problems with the input, exit with error if ($bInputFlag == false) { die( "Problem with your registration info. Please go back and try again."); } // Fields are clear, add user to database // Setup query $status=$session_begin=time(); $session_expire=time(); $q = "INSERT INTO tb_users (id, username, password, email, address, city, country, mobile, sessionstart, sessionexpire, ip, status) VALUES (NULL, '$_POST[username]', md5('$_POST[password]'), '$_POST[email]', '$_POST[address]', '$_POST[city]', '$_POST[country]', '$_POST[mobile]', '$session_begin', '$session_expire', '$_SERVER[REMOTE_ADDR]', $status)"; // Run query $r = mysql_query($q); // Make sure query inserted user successfully if ( !mysql_insert_id() ) { die("Error: User not added to database."); } else { //$mail->FromName = "ckap.in alerts"; //$mail->From = "ananthaprasad.ck@gmail.com"; //$mail->AddReplyTo("ananthaprasad.ck@gmail.com", "Anantha Prasad"); $to = $_POST['email']; $subject = "Confirm registration of your account with ckap.in"; $mail->isHTML(true); $mail->CharSet = 'UTF-8'; //sending the mail $mail->AddAddress($to); $mail->Subject = $subject; //end-----------------------------------------------email message--------------------------------------- $message = << Confirm registration of your account with ckap.in

Hi $_POST[username],

Please click the link below to activate your account in ckap.in

http://ckap.in/activation.php?email=$_POST[email]&code=$status

Please feel free to reply to me in case of any issue regarding to registration.

Best Wishes,

C. K. Anantha Prasad

EOD; //end-----------------------------------------------email message--------------------------------------- $mail->Body = $message; $mail->WordWrap = 50; if($mail->Send()) { // Redirect to thank you page. Header("Location: register.php?op=thanks"); } else { echo "Mailer Error: " . $mail->ErrorInfo; echo "Account not created try later"; die(); } } } // end if //The thank you page elseif ( $_GET["op"] == "thanks" ) { echo $html_body_one; echo $html_reg_thanks; echo $html_body_two; } //The web form for input ability else { echo $html_body_one; echo $html_reg_form; echo $html_body_two; } ?>