note 109725 added to function.mcrypt-module-open

From: Date: Tue, 14 Aug 2012 16:39:15 +0000
Subject: note 109725 added to function.mcrypt-module-open
Groups: php.notes 
Request: Send a blank email to php-notes+get-190067@lists.php.net to get a copy of this message
hi all ! I need the expertise here, i been through many resources yet could not find the answer. i am working on simple a login script with user registration, but could not find much help/ i would like to use 3des encryption on the passwords for new user registration, and able to login after registering. here goes my script. create_user.php <?php require 'C:\xampp\htdocs\myphp\course\scripts\database_connection.php'; // Get the user's information from the request into variables ?> <?php $username = ($_REQUEST['username']); $password = ($_REQUEST['password']); //$password = md5($password); $email = trim($_REQUEST['email']); //My testing //end testing // Handle user request $insert_sql = "INSERT INTO members (username, password, email) " . "VALUES ('{$username}', '{$password}', '{$email}');"; // Insert the user into the database mysql_query($insert_sql); ?> checklogin.php <?php ob_start(); $host="localhost"; // Host name $username="root"; // Mysql username $password="123"; // Mysql password $db_name="test"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Define $myusername and $mypassword $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" if(empty($myusername)){ $myusername = 'here the problem'; } $_SESSION['myusername'] = $myusername; $_SESSION['mypassword'] = $mypassword; header("location:login_success.php"); } else { echo "Please Try Again"; } ?> app_config.php <?php // Database connection constants define("DATABASE_HOST", "localhost"); define("DATABASE_USERNAME", "root"); define("DATABASE_PASSWORD", "123"); define("DATABASE_NAME", "test"); // Error reporting error_reporting(E_ALL); ?> Kindly assist ---- Server IP: 69.147.83.197 Probable Submitter: 218.186.12.10 ---- Manual Page -- http://www.php.net/manual/en/function.mcrypt-module-open.php Edit -- https://master.php.net/note/edit/109725 Del: integrated -- https://master.php.net/note/delete/109725/integrated Del: useless -- https://master.php.net/note/delete/109725/useless Del: bad code -- https://master.php.net/note/delete/109725/bad+code Del: spam -- https://master.php.net/note/delete/109725/spam Del: non-english -- https://master.php.net/note/delete/109725/non-english Del: in docs -- https://master.php.net/note/delete/109725/in+docs Del: other reasons-- https://master.php.net/note/delete/109725 Reject -- https://master.php.net/note/reject/109725 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#190067) next »