Results 1 to 6 of 6
-
28th Nov 2009, 04:25 AM #1OPMember
help about php.
Hey ,
I knw a lil php . and i wana knw how to make a basic login (username and pass )system using sqlunique1801 Reviewed by unique1801 on . help about php. Hey , I knw a lil php . and i wana knw how to make a basic login (username and pass )system using sql Rating: 5
-
28th Nov 2009, 08:06 AM #2MemberWebsite's:
Pirateview.org Gfxs.org StarkWood.orgThis is the html part of the code for the layout of the login box.
Code:<html> <head><title>Login System By NucleA</title></head> <body> <form method=GET action="login.php"> Username: <input type="TEXT" name="Username"><br/> Password: <input type="TEXT" name="Password"><br/> <input type="Submit" value="Login"> </body></html>
Code:<?php session_start(); mysql_connect("YOUR MYSQl SERVER", "MYSQL USERNAME", "MYSQL PASSWORD") or die(mysql_error()); mysql_select_db("Mysql Database") or die(mysql_error()); $username=$_GET['Username']; $password=$_GET['Password']; $ver=0; $result=mysql_query("SELECT * FROM table") or die(mysql_error()); while($row = mysql_fetch_array( $result )) { if($username=$row['Username']){ $ver=$ver+1; } else{ echo "Invalid Username!"; } if($password=$row['Password']){ $ver=$ver+1; } else{ echo "Invalid Password!"; } if ($ver=2){ echo "Successfull Login!"; $_SESSION['User']=REGISTERED; }
-
28th Nov 2009, 08:25 AM #3Member
Are you integrating this with an existing site or starting from scratch? If you're starting from scratch you might want to have a look at some of the different PHP frameworks available.
As for your question, this may help. http://www.webstockbox.com/php/7-tut...-login-system/...
-
28th Nov 2009, 09:08 AM #4Respected Member
Learn a bit more, you'll put yourself at risk from SQL Injections if you make a login system at your level. You should check out & learn these functions before you even think about starting this project:
mysql_real_escape_string
stripslashes
You should also learn about XSS attacks and how to protect your code from them.
-
28th Nov 2009, 05:19 PM #5Respected DeveloperWebsite's:
wrzc.orgI'd have to aggree with Loget on this one. The above one posted by NucleA is far from safe. It takes a lot of knowledge to write a secure safe login script.
Instead of writing it from scratch why not download a pre-made script that you just modify. Their are some good ones like http://www.php-login-script.com/ which you just add your own skin to and modify it as you need. Very safe, easy to modify and lots of features.Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic
Huge list of Warez Sites and free Multiposter Templates
-
28th Nov 2009, 05:36 PM #6Banned
To prevent XSS HTMLSPECIALCHAR all HTML output.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
themaCreator - create posts from...
Version 3.47 released. Open older version (or...