Google dot what?
Posts: 2
16 credits Members referred : 0
« on: Jun 20, 2010, 02:51:25 am »
hey, first of all thanks for the great class, it has definitely helped me learn a bit more about php user management.
i have got the script to successfully login, pull info from user (manually inserted) and such, however for some reason the registration from example2.php is not working with my registration code.
Code:
<?php
if($_POST['register'] == "true"){ if (!empty($_POST['username'])){ require_once('inc/access.class.php'); $user = new flexibleAccess(); $data = array( 'username' => $_POST['username'], 'password' => $_POST['password'], 'email' => $_POST['email'], 'active' => 1, 'banned' => 'no' ); $userID = $user->insertUser($data); if ($userID==0){ $register = "display:none;"; $login = "display:none;"; echo '<center>Registration Failed.<br><a href="login.php?action=register" target="_self">Please Try Again.</center>'; } else { $register = "display:none;"; $login = "display:none;"; echo 'User registered with user id '.$userID; } } else { $register = "display:none;"; $login = "display:none;"; echo '<center>Please fill in all required fields.<br><a href="login.php?action=register" target="_self">Please Try Again.</center>'; } }
?>
that is what is in my login.php?action=register page, the form is set up properly, all fields match the required $_POSTs, yet any time i try to register i get $userID = 0 my usertable was created from the supplied sql code and the only thing i've changed is that i added the 'banned' userfield, which i have declared in the array. i've tried this with and without it and i am getting the same result.
if anyone is willing to give me a hand i'd be more than grateful for it.
Google dot what?
Posts: 2
16 credits Members referred : 0
« Reply #1 on: Jun 20, 2010, 05:52:29 pm »
No one available to help?
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=10137