Secure login/registration

Noob reporting live here,
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 :slight_smile:


<?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(); } else { echo 'ERROR'; } ?>


I forgot I took out the header in trying to get it to work.
Sorry I don’t see an edit option for my post.

Sponsor our Newsletter | Privacy Policy | Terms of Service