Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
HabboPixel - Login/Register Help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="xXMufaisaXx" data-source="post: 454492" data-attributes="member: 80391"><p>So I took that HabboPixel cms release and ive been working on it. Ive already fixed everything up including login but I cant seem to figure out what im doing wrong with register, Any help would be very much appreciated.</p><p>It says register successful but isnt inserting data.</p><p></p><p>Snip of reg form:</p><p>[CODE]<form id="form" method="post" action="<?= URL; ?>/app/signup.php"></p><p> <div id="response"></div></p><p> <input type="text" id="guideUsername" name="username" value="" class="form-control input" placeholder="Username"></p><p> <input type="mail" id="guideEmail" name="email" value="" class="form-control input" placeholder="Email"></p><p> <input type="password" id="guidePassword" name="password" class="form-control input" placeholder="Password"></p><p> <input type="password" id="guideRePassword" name="password_confirmation" class="form-control input" placeholder="Confirm Password"></p><p> <button type="submit" class="btn btn-signup">Register</button></p><p> </form>[/CODE]</p><p></p><p>Snip of signup(submit):</p><p>[CODE]</p><p><?php</p><p>require '../global.php';</p><p>$pdo = New Database();</p><p>$account->IPisBanned($_SERVER['REMOTE_ADDR']);</p><p>$account->isConnected();</p><p>ini_set('display_errors', 1);</p><p>if(!empty($_POST['username']) AND !empty($_POST['email']) AND !empty($_POST['password']) AND !empty($_POST['password_confirmation'])) {</p><p> $bdd = $pdo->query('SELECT id FROM users WHERE username = ?', [$core->F_HTML($_POST['username'])]);</p><p> if($bdd->rowCount() == 0) {</p><p> if(preg_match('`^([a-zA-Z0-9-=?!@]{3,15})$`', $core->F_HTML($_POST['username']))) {</p><p> $bdd2 = $pdo->query('SELECT id FROM users WHERE mail = ?', [$core->F_HTML($_POST['email'])]);</p><p> if($bdd2->rowCount() == 0) {</p><p> if(filter_var($core->F_HTML($_POST['email']), FILTER_VALIDATE_EMAIL)) {</p><p> if($_POST['password'] == $_POST['password_confirmation']) {</p><p> if(strlen($_POST['password']) >= 6 AND strlen($_POST['password_confirmation']) >= 6) {</p><p> $bdd3 = $pdo->query('INSERT INTO users (username, password, mail, credits, vip_points, activity_points, look, motto, account_created, ip_reg) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', [$core->F_HTML($_POST['username']), $core->C_PASS($_POST['password']), $core->F_HTML($_POST['email']), "0", "0", "0", "ch-235-92.sh-295-92.hr-3163-61.hd-180-1.lg-275-92", "Nouveau !", time(), $_SERVER['REMOTE_ADDR']]);</p><p> $_SESSION['id'] = $pdo->lastInsertId();</p><p> echo 'success';</p><p> } else {</p><p> echo 'Passwords do not match.';</p><p> }</p><p> } else {</p><p> echo 'Your password must contain more than 6 characters.';</p><p> }</p><p> } else {</p><p> echo 'Your email address is not valid.';</p><p> }</p><p> } else {</p><p> echo 'This email address is already taken.';</p><p> }</p><p> } else {</p><p> echo 'Username is not valid.';</p><p> }</p><p> } else {</p><p> echo 'This username is already taken.';</p><p> }</p><p>} else {</p><p> echo 'Please fill out all fields.';</p><p>}</p><p>?></p><p>[/CODE]</p><p></p><p>Thank you all in advance (Y)</p></blockquote><p></p>
[QUOTE="xXMufaisaXx, post: 454492, member: 80391"] So I took that HabboPixel cms release and ive been working on it. Ive already fixed everything up including login but I cant seem to figure out what im doing wrong with register, Any help would be very much appreciated. It says register successful but isnt inserting data. Snip of reg form: [CODE]<form id="form" method="post" action="<?= URL; ?>/app/signup.php"> <div id="response"></div> <input type="text" id="guideUsername" name="username" value="" class="form-control input" placeholder="Username"> <input type="mail" id="guideEmail" name="email" value="" class="form-control input" placeholder="Email"> <input type="password" id="guidePassword" name="password" class="form-control input" placeholder="Password"> <input type="password" id="guideRePassword" name="password_confirmation" class="form-control input" placeholder="Confirm Password"> <button type="submit" class="btn btn-signup">Register</button> </form>[/CODE] Snip of signup(submit): [CODE] <?php require '../global.php'; $pdo = New Database(); $account->IPisBanned($_SERVER['REMOTE_ADDR']); $account->isConnected(); ini_set('display_errors', 1); if(!empty($_POST['username']) AND !empty($_POST['email']) AND !empty($_POST['password']) AND !empty($_POST['password_confirmation'])) { $bdd = $pdo->query('SELECT id FROM users WHERE username = ?', [$core->F_HTML($_POST['username'])]); if($bdd->rowCount() == 0) { if(preg_match('`^([a-zA-Z0-9-=?!@]{3,15})$`', $core->F_HTML($_POST['username']))) { $bdd2 = $pdo->query('SELECT id FROM users WHERE mail = ?', [$core->F_HTML($_POST['email'])]); if($bdd2->rowCount() == 0) { if(filter_var($core->F_HTML($_POST['email']), FILTER_VALIDATE_EMAIL)) { if($_POST['password'] == $_POST['password_confirmation']) { if(strlen($_POST['password']) >= 6 AND strlen($_POST['password_confirmation']) >= 6) { $bdd3 = $pdo->query('INSERT INTO users (username, password, mail, credits, vip_points, activity_points, look, motto, account_created, ip_reg) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', [$core->F_HTML($_POST['username']), $core->C_PASS($_POST['password']), $core->F_HTML($_POST['email']), "0", "0", "0", "ch-235-92.sh-295-92.hr-3163-61.hd-180-1.lg-275-92", "Nouveau !", time(), $_SERVER['REMOTE_ADDR']]); $_SESSION['id'] = $pdo->lastInsertId(); echo 'success'; } else { echo 'Passwords do not match.'; } } else { echo 'Your password must contain more than 6 characters.'; } } else { echo 'Your email address is not valid.'; } } else { echo 'This email address is already taken.'; } } else { echo 'Username is not valid.'; } } else { echo 'This username is already taken.'; } } else { echo 'Please fill out all fields.'; } ?> [/CODE] Thank you all in advance (Y) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
HabboPixel - Login/Register Help
Top