Jump to content

cameeob2003

Members
  • Posts

    79
  • Joined

  • Last visited

    Never

Everything posted by cameeob2003

  1. How would I go about getting the passwords encripted. I am new to the entire php thing if you have a link or something you can give me to guide me in the right direction that would be great.
  2. [code]<?php $host="myhost"; // Host name $username="user"; // Mysql username $password="pass"; // Mysql password $db_name="dbname"; // Database name $tbl_name="users"; // Table name ?> <?php // 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"); // username and password sent from signup form $myusername=$_POST['myusername']; $mypassword=$_POST['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" session_register("myusername"); session_register("mypassword"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ?> [/code] I am trying to get this to select the users from my MySQL database and allow them to login. But when I try to get the page to use this script it says "Wrong Username or Password". That is what i wanted it to say but I also want it LOG IN. I cant find out why it wont select the username and password to auth. Any help would be great.
  3. I was wanting the following to display: [code]<form name="form1" method="post" action="login/checklogin.php">                             <div style="position: absolute; top: 191px; left: 253px;">                             <input style="position: absolute; top: 2px; left: 60px; width: 100px; height= 20px;" name="myusername" type="text" id="myusername">                             <input style="position: absolute; top: 25px; left: 60px; width: 100px; height= 20px;" name="mypassword" type="text" id="mypassword">                             <input style="position: absolute; top: 52px; left: 120px; background-image: url(img/login_button.gif); width: 51px; height: 15px; border: 0;" type="submit" name="Submit" value="">[/code] Only if the user is not logged in. If the user is logged in I want it to show an admin/user panel. I was wondering how I would go about doing this. I dont need the scripting for the admin panel just for the displaying portion. Any help is appreciated.
  4. Im kinda new to the entire php programming thing and was wondering what commands line(s) i would use to make sure that when someone enters in a password to reg they enter it twice and then the php script verifies that the 2 passwords are the same. Any help is appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.