darkfreaks Posted March 1, 2008 Share Posted March 1, 2008 ok i think i have this nearly solved but i made a huge if statement of issets or !empty to assure no blank values went into the database. but i still get some blank values mainly blank usernames when i try to signup it errors " error please fill out the form and try again" but it still is submitting somehow and cannot figure it out. <?php if (isset($_POST['process'])||!empty($_POST['process'])|| !empty($_POST['random_id'])||!empty($_POST['username']) ||!empty($_POST['password'])||!empty($_POST['password_c'])|| !empty($_POST['email'])||!empty($_POST['email_c']) ||!empty($_POST['security_code'])||isset($_POST['random_id'])|| isset($_POST['username'])||isset($_POST['password']) ||isset($_POST['password_c'])||isset($_POST['email'])||isset($_POST['email_c']) ||isset($_POST['security_code'])){ // Try to register the user if ($qls->User->register_user()) { switch ($qls->config['activation_type']) { default: echo REGISTER_SUCCESS_NO_ACTIVATION; break; case 1: echo REGISTER_SUCCESS_USER_ACTIVATION; break; case 2: echo REGISTER_SUCCESS_ADMIN_ACTIVATION; break; } } else { // Output register error echo $qls->User->register_error . REGISTER_TRY_AGAIN; } } else { // Get the random id for use in the form $random_id = $qls->Security->generate_random_id(); require_once('html/register_form.php'); } } else { echo REGISTER_ALREADY_LOGGED; }?> Quote Link to comment Share on other sites More sharing options...
trq Posted March 1, 2008 Share Posted March 1, 2008 Your code is pretty hard to read, but I don't se anywhere where it might insert a user into the database? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted March 1, 2008 Author Share Posted March 1, 2008 nevermind thorpe i found the function to insert in the user class file and i just need to add if not empty to the same variables in that file and it should work. Quote Link to comment Share on other sites More sharing options...
trq Posted March 1, 2008 Share Posted March 1, 2008 How about simply not executing said file if your form variables are empty, makes more sense. Classes should not be hacked, they outght be designed to work without needing to make changes to them. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.