marcs910 Posted April 8, 2007 Share Posted April 8, 2007 Mk. Can some please tell me why "$a = md5(uniqid(rand(),true))" is not inserting my code into my table? if (empty($errors)) { // Register the user in the database. // Check for previous registration. $query = "SELECT user_id FROM users WHERE email='$e'"; $result = mysql_query($query); if (mysql_num_rows($result) == 0) { //Create the activate code $a = md5(uniqid(rand(),true)); // Make the query. $query = "INSERT INTO users (first_name, last_name, email, password, company_name, description, address, city, state, zip, phone, fax, cell, web_address, active, registration_date) VALUES ('$fn', '$ln', '$e', SHA('$p'), '$cn', '$desc', '$add', '$city', '$st', '$z', '$ph', '$fax', '$cell', '$web', '$a', NOW() )"; $result = @mysql_query ($query); // Run the query. if ($result) { // If it ran OK. // Send an email, if desired. // Redirect the user to the thanks.php page. // Start defining the URL. $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); // Check for a trailing slash. if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) { $url = substr ($url, 0, -1); // Chop off the slash. } // Add the page. $url .= '/thanks.php'; header("Location: $url"); exit(); Link to comment https://forums.phpfreaks.com/topic/46181-create-and-insert/ Share on other sites More sharing options...
marcs910 Posted April 8, 2007 Author Share Posted April 8, 2007 I figured it out. I hadnt changed my submit. It was still pointing to my old page. Link to comment https://forums.phpfreaks.com/topic/46181-create-and-insert/#findComment-224535 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.