|
You last visited: Today at 02:01
Advertisement
5017 reg page?
Discussion on 5017 reg page? within the CO2 Private Server forum part of the Conquer Online 2 category.
08/23/2014, 06:28
|
#1
|
elite*gold: 0
Join Date: Jan 2014
Posts: 69
Received Thanks: 2
|
5017 reg page?
Anyone have a 5017 register page around :P? i tried searching for it but the download links are broken
|
|
|
08/23/2014, 06:34
|
#2
|
elite*gold: 15
Join Date: Dec 2008
Posts: 332
Received Thanks: 137
|
Just take a register page for another version and change the variables & structure so it works with your source.
Or just make one.
|
|
|
08/23/2014, 15:09
|
#3
|
elite*gold: 130
Join Date: Oct 2007
Posts: 1,655
Received Thanks: 705
|
And since when is a register page patch based? -_-
|
|
|
08/23/2014, 16:13
|
#4
|
elite*gold: 0
Join Date: Jul 2009
Posts: 943
Received Thanks: 408
|
Give me your table name and columns that will be used with description, i may build the PHP but you will need to make the form.
And i use PDO for MySql, not the mysql_* shit
*Edit
Well, i made it... Just edit.. hope its useful
Code:
<?php
/*
* Generic Register Page
* Author: Felipe Vieira Vendramini
* Configuration
*/
$MySql["Host"] = "localhost"; // host, duuh
$MySql["User"] = "root"; // Username
$MySql["Pass"] = "test"; // Password
$MySql["Data"] = "zf"; // Database
$Database = new PDO('mysql:host='.$MySql["Host"].';dbname='.$MySql["Data"].';charset=utf8', $MySql["User"], $MySql["Pass"], array(PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
$Database->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
/*
* Common Functions
*/
function CheckIfNegative($Number)
{
if($Number < 0)
{
$Number *= (-1);
}
return $Number;
}
function CheckINT($Number)
{
if(filter_var($Number, FILTER_VALIDATE_INT) === false)
{
return false;
}
return true;
}
function ValidateUser($string){
$expression = "[A-Za-z0-9]";
if(preg_match($expression, $string)){
return true;
}
return false;
}
function ValidateEmail($string){
$string = strtolower($string);
$expression = "/([\w\-]+\@[\w\-]+\.[\w\-]+)/";
if(preg_match($expression, $string)){
return true;
}
return false;
}
/*
* Form validation
* Fill:
* Username: varchar(16)
* Password: varchar(16)
* SecurityCode: bigint(8)
* Email: varchar(64)
*/
if(!ValidateUser($_POST["Username"]) || !ValidateUser($_POST["Password"])){
//Handle Invalid Username or Password
}
$Username = $_POST["Username"];
$Password = $_POST["Password"];
if(strlen($_POST["Username"]) < 6 || strlen($_POST["Username"]) > 16){
//Handle Username Lenght Error
}
if(strlen($_POST["Password"]) < 6 || strlen($_POST["Password"]) > 16){
//Handle Password Lenght Error
}
$CheckName = $Database->prepare("SELECT username FROM `account` WHERE `username`=:name");
$CheckName->bindValue(':name', $Username, PDO::PARAM_STR);
$CheckName->execute();
$CountN = $CheckName->rowCount();
if($CountN > 0){
//Handle Existing Username
}
if(!ValidateEmail($_POST["Email"])){
//Handle Invalid E-mail
}
$Email = $_POST["Email"];
$CheckMail = $Database->prepare("SELECT email FROM `account` WHERE `email`=:mail");
$CheckMail->bindValue(':mail', $Email, PDO::PARAM_STR);
$CheckMail->execute();
$CountM = $CheckMail->rowCount();
if($CountM > 0){
//Handle Existing Mail
}
$SecurityCode = CheckIfNegative($_POST["SecurityCode"]);
if(!CheckINT($SecurityCode)){
//Handle Invalid format Security Code
}
if($SecurityCode < 10000000){
//Handle 8 Digits Security Code Error
}
$InsertRow = $Database->prepare("INSERT INTO account (`username`,`password`,`email`,`code`) VALUES (:name, :pass, :mail, :code)");
$InsertRow->bindValue(':name', $Username, PDO::PARAM_STR);
$InsertRow->bindValue(':pass', $Password, PDO::PARAM_STR);
$InsertRow->bindValue(':mail', $Email, PDO::PARAM_STR);
$InsertRow->bindValue(':code', $SecurityCode, PDO::PARAM_INT);
$Check = $InsertRow->execute();
if(!$Check){
//Handle Insert failed
}
die("OK");
Good Luck
|
|
|
 |
Similar Threads
|
Looking for a simple Registration Page (5017)
03/24/2013 - CO2 Private Server - 0 Replies
Hey guys I am looking for a simple registration page for patch 5017 just where you have to put it your account id thats it! Couldn't find any working links for one so I am asking here! Hope you guys can help me :P
MasterZ
|
Need A Reg Page 5017
09/25/2012 - CO2 Private Server - 4 Replies
Tittle sais it all, i need a register page for 5017. Yeah i know, i have searched everywhere but i cant find a single 1. So if any 1 can help me out on that would b a great help... Im making a 5017 cuz i hate talis n shit so yeah ... dont ask
|
I need Page register 5017
05/04/2010 - CO2 Private Server - 2 Replies
I need Page register Appserv+hamachi 5017
|
[HELP] 5017 Registration Page?
10/11/2009 - CO2 Private Server - 3 Replies
Can you give me a link to a v5017 registration page, please. I'll press thanks!
|
[RELEASE] Registration Page (5017)
09/18/2009 - CO2 PServer Guides & Releases - 8 Replies
Download the website.rar, change the settings, and put in the folder www from appserv. Press thank you!
MEGAUPLOAD - The leading online storage and file delivery service
|
All times are GMT +1. The time now is 02:02.
|
|