Notes
Notes - notes.io |
include "inc/init.php";
include 'lib/captcha/captcha.php';
if($user->islg()) {
header("Location: $set->url");
exit;
}
$page->title = "Register to ". $set->site_name;
$captcha = ((!$set->captcha) || ($set->captcha && isset($_SESSION['captcha']) && isset($_POST['captcha']) && ($_SESSION['captcha']['code'] === $_POST['captcha'])));
if($_POST && isset($_SESSION['token']) && ($_SESSION['token'] == $_POST['token']) && $set->register && $captcha) {
$name = $_POST['name'];
$display_name = $_POST['display_name'];
$email = $_POST['email'];
$password = $_POST['password'];
if(!isset($name[3]) || isset($name[30]))
$page->error = "Username too short or too long !";
if(!$options->validUsername($name))
$page->error = "Invalid username !";
if(!isset($display_name[3]) || isset($display_name[50]))
$page->error = "Display name too short or too long !";
if(!isset($password[3]) || isset($password[30]))
$page->error = "Password too short or too long !";
if(!$options->isValidMail($email))
$page->error = "Email address is not valid.";
if($db->getRow("SELECT `userid` FROM `".MLS_PREFIX."users` WHERE `username` = ?s", $name))
$page->error = "Username already in use !";
if($db->getRow("SELECT `userid` FROM `".MLS_PREFIX."users` WHERE `email` = ?s", $email))
$page->error = "Email already in use !";
if(!isset($page->error)){
$user_data = array(
"username" => $name,
"display_name" => $display_name,
"password" => sha1($password),
"email" => $email,
"lastactive" => time(),
"regtime" => time(),
"validated" => 1
);
if($set->email_validation == 1) {
$user_data["validated"] = $key = sha1(rand());
$link = $set->url."/validate.php?key=".$key."&username=".urlencode($name);
$url_info = parse_url($set->url);
$from ="From: not.reply@".$url_info['host'];
$sub = "Activate your account !";
$msg = "Hello ".$options->html($name).",<br> Thank you for choosing to be a member of out community.<br/><br/> To confirm your account <a href='$link'>click here</a>.<br>If you can't access copy this to your browser<br/>$link <br><br>Regards<br><small>Note: Dont reply to this email. If you got this email by mistake then ignore this email.</small>";
if(!$options->sendMail($email, $sub, $msg, $from))
$user_data["validated"] = 1;
}
if(($db->query("INSERT INTO `".MLS_PREFIX."users` SET ?u", $user_data)) && ($id = $db->insertId()) && $db->query("INSERT INTO `".MLS_PREFIX."privacy` SET `userid` = ?i", $id)) {
$page->success = 1;
$_SESSION['user'] = $id;
$user = new User($db);
} else
$page->error = "There was an error ! Please try again !";
}
} else if($_POST)
if(!$captcha)
$page->error = "Invalid captcha code !";
else
$page->error = "Invalid request !";
include 'header.php';
if(!$set->register)
$options->fError("We are sorry registration is blocked momentarily please try again leater !");
$_SESSION['token'] = sha1(rand());
if($set->captcha)
$_SESSION['captcha'] = captcha();
$extra_content = '';
if(isset($page->error))
$extra_content = $options->error($page->error);
if(isset($page->success)) {
echo "<div class='container'>
<div class='span3 hidden-phone'></div>
<div class='span6 well'>
<h1>Congratulations !</h1>";
$options->success("<p><strong>Your account was successfully registered !</strong></p>");
echo " <a class='btn btn-primary' href='$set->url'>Start exploring</a>
</div>
</div>";
} else {
if($set->captcha)
$captcha = "
<div class='control-group'>
<label class='control-label' for='captcha'>Enter the code:</label>
<div class='controls'>
<img src='".$_SESSION['captcha']['image_src']."'><br/>
<input type='text' class='input-xlarge' name='captcha' id='captcha'>
</div>
</div>";
else
$captcha = '';
echo "
<div class='container'>
<div class='span3 hidden-phone'></div>
<div class='span6'>
".$extra_content."
<form action='#' id='contact-form' class='form-horizontal well' method='post'>
<fieldset>
<legend>Register Form </legend>
<div class='control-group'>
<label class='control-label' for='name'>Username</label>
<div class='controls'>
<input type='text' class='input-xlarge' name='name' id='name'>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='display_name'>Display name</label>
<div class='controls'>
<input type='text' class='input-xlarge' name='display_name' id='display_name'>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='email'>Email Address</label>
<div class='controls'>
<input type='text' class='input-xlarge' name='email' id='email'>
</div>
</div>
<div class='control-group'>
<label class='control-label' for='password'>Password</label>
<div class='controls'>
<input type='password' class='input-xlarge' name='password' id='password'>
</div>
</div>
<input type='hidden' name='token' value='".$_SESSION['token']."'>
$captcha
<div class='form-actions'>
<button type='submit' class='btn btn-primary btn-large'>Register</button>
<button type='reset' class='btn'>Reset</button>
</div>
</fieldset>
</form>
</div>
</div>";
}
include "footer.php";
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team