August 3, 200818 yr Hi All, I need help with a login page for a customer's site: The login details will be set out by my client for that customer that will then take them to their page. The username and password will be issued by my client. 1st off how do i do this 2nd How to do a database for that input of data from the client from the website. Any help and advise would be very helpful Cheers Lee
August 3, 200818 yr Do you know how to develop application code in any server side language (PHP, ASP, RUBY)? Are you familiar with any database technology (MySQL, Postgress, Oracle)? If the answer to the above is no then I would suggest that you need to hire the help of someone that does have some basic knowledge of web application development. On the other hand if you do know something about server side coding and database development then maybe if you are more specific with the question it will be easier to help you. At the moment its a bit like me asking 'my client wants a new logo with their name on it somewhere' can you tell me how to draw one?
August 3, 200818 yr I may have script which is perfect for you, it depends how often it will need updated if at all?
August 3, 200818 yr Author the script would be great if you would like to share that... It will need updating about every week if that
August 3, 200818 yr Author I've created a page called login.html which has the following on: <form method="post" action=""> <fieldset> <legend>login</legend> <p><label for="name">Username: </label><input type="text" name="name" id="name" /></p> <p><label for="password">Password: </label><input type="password" name="password" id="password" /></p> <input type="submit" name="submit" id="submit" value="Login" class="btn" /> </fieldset> </form> So when a client is given a username and password it takes then to a specific page and only them with that login details can view that page is what am trying to achieve...... Any help on this
August 3, 200818 yr Ok well my script doesn't let you go to different pages depending on the user's login. It just puts a username and password box on before they enter the page a bit like secure folders but with a styled page for login.
August 3, 200818 yr Author God!!!!Damm I'm so stuck it's doing my head in any of you giys out there can you help quick b4 i commit murder LOL I hate been beaten by daft script's that i know am capable of just need guidance
August 3, 200818 yr Author I want to gain the following: User is given a username and password for instance - qwerty is username qwerty is password. They then log on to a specific page lets say test.html after they click login it then take them to a specific page(s) only available if you have the above credtionals; so lets say i have logged in using above creds, it would then take me to lets say test2.html. After they logout all is removed and that username and password would have to eneterd again in order to view that page. Hope this makes more sense and i would be VERY GRATeful if someone could help me.... In advnce thanks
August 4, 200818 yr Author No-one going to give advise on this??? There must be one of you out there that will want to help a fellow designer.... PLease please i badly need help!!!!! Lee
August 6, 200818 yr Author Still...no-one giving advice or pre-written script on here ??? tut tut... Come guys help me out pls... Lee
August 8, 200818 yr Author I want to gain the following: User is given a username and password for instance - qwerty is username qwerty is password. They then log on to a specific page lets say test.html after they click login it then take them to a specific page(s) only available if you have the above credtionals; so lets say i have logged in using above creds, it would then take me to lets say test2.html. After they logout all is removed and that username and password would have to eneterd again in order to view that page. Hope this makes more sense and i would be VERY GRATeful if someone could help me....
August 8, 200818 yr Where will you store the usernames and passwords? A MySQL database? Until you answer this, we cannot help you. Are you using PHP (or something else? Ruby? ASP.NET?). You are being too vague. We understand what you want to achieve, but we must know how you want to achieve it.
August 9, 200818 yr Hi Lee After many hours off testing I finally got a login script to redirect depending on the username and password submitted. <?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="your database"; // Database name $tbl_name="members"; // Table name mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $username=$_POST['username']; $password=$_POST['password']; $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $sql="SELECT location FROM $tbl_name WHERE username='$username' and password='$password' "; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ session_register("username"); session_register("password"); session_register("id"); $get_url = "SELECT location FROM $tbl_name WHERE username='$username' and password='$password' "; $url=mysql_query($get_url); $row = mysql_fetch_assoc($url); $max_id=$row['location']; header('Location: '.$max_id); exit; } else { echo "Wrong Username or Password"; } ?> The database set up is as follows: Table name is members Field Type Collation Attributes Null Default Extra id int(4) No auto_increment username varchar(100) latin1_bin No password varchar(100) latin1_bin No location varchar(200) latin1_bin No ensure the id field is set to primary key. Put a couple of username, passwords and locations into the database and give it a try. I have tested this and it does work. Pat
August 10, 200818 yr Forgot to post the form <form method="post" action="checklogin.php"> <fieldset> <legend>Create User</legend> <p><label for="Username">Username: </label><input type="text" name="username" id="username" /></p> <p><label for="Password">Password: </label><input type="password" name="password" id="password" /></p> <input type="submit" name="submit" id="submit" value="Register" class="btn" /> </fieldset> </form> This would br the login form Pat
August 10, 200818 yr Author on what page would i put the first code you put would that go on same page has the form (for example contact.php)??? Also what would the "action" be in the form??? Would that be to the users page or something???
August 10, 200818 yr Author Cos when i just checked the code i put i into login.php form page, and cos the action is pointing to checklogin.php it then goes to a page which i done saying you are now logged in.... I need the script to import the data from a form to MySQL then be able to login using the credtionals they have registered with. Can you help?
August 10, 200818 yr Cos when i just checked the code i put i into login.php form page, and cos the action is pointing to checklogin.php it then goes to a page which i done saying you are now logged in.... I need the script to import the data from a form to MySQL then be able to login using the credtionals they have registered with. Can you help? The form can be called anything you like I called it main_login.php the action is looking for checklogin.php, so save the following code as checklogin.php <?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="your database"; // Database name $tbl_name="members"; // Table name mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $username=$_POST['username']; $password=$_POST['password']; $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $sql="SELECT location FROM $tbl_name WHERE username='$username' and password='$password' "; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ session_register("username"); session_register("password"); session_register("id"); $get_url = "SELECT location FROM $tbl_name WHERE username='$username' and password='$password' "; $url=mysql_query($get_url); $row = mysql_fetch_assoc($url); $max_id=$row['location']; header('Location: '.$max_id); exit; } else { echo "Wrong Username or Password"; } ?> As it stands the user will enter his/her username and password into main_login.php, on submit the checklogin script will check the username and password if its ok it will redirect that user to the location specified in the database against that specific user. I was led to believe that your client is issuing usernames and passwords manually and manually inserting them in the database. Pat
August 10, 200818 yr Author Cheers pat once again your a star.... Question will this insert them in MySQL? How o i get a form which will collect the data and then input it into MySQL?
August 10, 200818 yr Hi lee At the moment you have a database with usrename, password and location You have a login form that will redirect the user to his/her own page using checklogin.php Do you now require a register form where they can register and then recieve by e-mail a password and username, if so that shouldnt be to much of a problem, the problem will be allocating each registration a location. and then creating that page on your server. Pat
August 10, 200818 yr Yes if you can tell and show me how that would great, cheers again Unfortunately I have to go to Scotland for a week (work) hopefully someone will be able to help, if not I will be back a week Monday. Pat
August 10, 200818 yr Author Ok no worries, i'll try and figure it out (doubt i will im just a baby php) Cheers anyway
Create an account or sign in to comment