LocaButt Posted April 2, 2013 Share Posted April 2, 2013 I Posted in another forum but I'm not getting any suggestions. Hopefully you all can help me. I have looked everywhere the past 2 days. I have flip-flopped this thing a million different ways - still no luck.Can someone PLEASE help me and tell me what I need to do to get this thing working?I found this script online for secure login, there was no registration page included so I have been trying to make one work.As of now it goes from the registration page(form) to process_registration (this page) then should redirect to index.htm if it is successful. If there is no password entered, it should just say error.I get connected to the database , "Localhost via UNIX socket" is what I get in the browser. No entries, however.Thanks a lot <script type="text/javascript" src="sha512.js"></script> <?php include 'db_connect.php'; if (isset($_POST['password'])) { $Username = $_POST['username']; $Email = $_POST['email']; $Password1 = $_POST['password']; $Random_Salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true)); $Password = hash('sha512', $Password1.$Random_Salt); $ip = $_SERVER['REMOTE_ADDR']; $ml = $_POST['mailinglist']; $insert_stmt = $mysqli->prepare('INSERT INTO members (username, email, password, salt, ipaddress, date, mailinglist) VALUES (?, ?, ?, ?, ?, ?, ?)'); $insert_stmt->bind_param('sssssis', $Username, $Email, $Password, $Random_Salt, $ip, NOW(), $ml); $insert_stmt->execute(); header ['Location: index.htm']; } else { echo 'ERROR'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/276406-help-with-secure-loginregistration/ Share on other sites More sharing options...
nbst Posted April 2, 2013 Share Posted April 2, 2013 There are many issues present here, but for actually getting it to work: Are you not receiving any errors? Place error_reporting(-1); right below the opening <?php line just to be sure. Do you have the database table created with a schema that lines up with what is in the query? The header() call should use parentheses and not brackets. nbst Quote Link to comment https://forums.phpfreaks.com/topic/276406-help-with-secure-loginregistration/#findComment-1422382 Share on other sites More sharing options...
LocaButt Posted April 2, 2013 Author Share Posted April 2, 2013 Still no luck, I am still getting the same thing in the browser. No errors, just "Localhost via UNIX socket" The table is already made. Thanks very much for replying. Quote Link to comment https://forums.phpfreaks.com/topic/276406-help-with-secure-loginregistration/#findComment-1422383 Share on other sites More sharing options...
Jessica Posted April 2, 2013 Share Posted April 2, 2013 You're not capturing mysql errors, see my signature for that. Did you query the DB directly? Quote Link to comment https://forums.phpfreaks.com/topic/276406-help-with-secure-loginregistration/#findComment-1422389 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.