Jul 25, 2008

Php Simple Login Tutorial - Learn how to make a simple login!

Free Web Hosting, No Ads > CONTRIBUTE > Tutorials
Pages: 1, 2, 3, 4, 5, 6, 7

free web hosting

Php Simple Login Tutorial - Learn how to make a simple login!

hhPHP
Wow, good guide, this is some good stuff, keep up the goodness, you get a reputation point...

Reply

snlildude87
Welcome to trap17, hhPHP.

Reply

elevenmil
As many of you just might know, I'm tryin to get this log in and register stuff down, but I keep running into problems... For your tutorial I keep getting this message everytime I open my .php files in my browser.


CODE
Fatal error: Call to undefined function: mildawg_dbconfig() in /home/mildawg/public_html/dbConfig.php on line 20


any thoughts? Thanks for the help.

Reply

HmmZ
Hmm,

the error says theres a problem on line 20...
CODE
// Then you need to make sure the database you want
// is selected.
mysql_select_db($db);
?>


try the following:
CODE
mysql_select_db("$db",$ms);


if that doesnt work you can try to take off the apostrophes, if the problem still persists please reply again

P.S. please don't forget that Trap17 uses your cPanel username in db usernames and dbs, e.g. cpanelusername_dbusername and yourcpanelusername_dbname.

Reply

cragllo
I have not tried this YET, but i read through the code, in register.php

where is the information inserted into the db?
CODE
 // Create query
$q = "SELECT * FROM `dbUsers` "
 ."WHERE `username`='".$_POST["username"]."' "
 ."AND `password`=PASSWORD('".$_POST["password"]."') "
 ."LIMIT 1";

I see taht bit, but that just selects data out of the db dosent it?
Correct me if im wrong, just learning... smile.gif

Reply

elevenmil
Hmmz, I adjusted my code and the error went away, but when I went to try it out and register, yep, I hit another roadblock...it says...

CODE
Error: User not added to database.



...frustrating...

what do you make of this?

Reply

elevenmil
Sorry about the double post...but its 4 AM and I'm goin to bed but I saw somethin else...in addition to my previous post whenever I registered to check what would happen and it said user not added to database...I went to my phpMyAdmin and looked at my table....and my username WAS added...this just adds to my confusion

Any help?

Reply

HmmZ
I think I see the problem, its checking a wrong query, try the following (old code first to see where you can find it)

CODE
// Fields are clear, add user to database
//  Setup query
$q = "INSERT INTO `dbUsers` (`username`,`password`,`email`) "
 ."VALUES ('".$_POST["username"]."', "
 ."PASSWORD('".$_POST["password"]."'), "
 ."'".$_POST["email"]."')";
//  Run query
$r = mysql_query($q);

// Make sure query inserted user successfully
if ( !mysql_insert_id() )
 {
 die("Error: User not added to database.");
 }


replace if(!mysql_insert_id()) with this:
CODE
if(!$r)


let me know if that fixes your problem

 

 

 


Reply

elevenmil
I inserted your code, but nothing changed, still got the error user not added to database thingy....

What else can you suggest? Thanks...I'll keep messin around with it

Reply

rambo406
i am noob in PHP so i just follow the instruction thanks man

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2, 3, 4, 5, 6, 7
Recent Queries:-
  1. php login tutorials - 0.42 hr back. (1)
  2. php simple login example - 1.70 hr back. (1)
  3. php login tutorial - 1.45 hr back. (2)
  4. how to make simple php login - 2.97 hr back. (1)
  5. simple php login system - 3.65 hr back. (1)
  6. php simple login page example - 5.27 hr back. (1)
  7. php coding for login - 5.99 hr back. (1)
  8. user login in php example - 6.41 hr back. (1)
  9. javascript to make log in and log out functions and registrations to a database - 8.48 hr back. (1)
  10. php login script tutorial - 8.58 hr back. (1)
  11. creste simple login - 10.19 hr back. (1)
  12. simple php login tutorial - 14.02 hr back. (1)
  13. php secure login tutorial - 14.18 hr back. (1)
  14. use php login tutorial - 15.03 hr back. (1)
Similar Topics

Keywords : php, simple, login, learn, make, simple, login

  1. To Automatically Run Command When Login / Logoff
    (3)
  2. Simple Php Login And Registration System
    (10)
    Hello. This is my first web tutorial ever. This is basically a simple register and login script.
    Yes, I know it’s a bit rubbish but I’m quite new to PHP/MySQL. Here’s the register form. This can
    be any file extension you like. I’d recommend calling it register.html . CODE
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html
    xmlns="http://www.w3.org/1999/xhtml"> <head> <meta
    http-equiv="Content-Type" content="text/ht....
  3. Flatfile User Login/signup
    Uses text files only (compatable with forums and message system) (24)
    With this tutorial, you will learn how to create a textfile login script. This user membership
    script is for use also with my forums and message system scripts. I will also give you the scripts
    to make it so that people can change their profiles. Ok, The first thing we need to do is make the
    database. To do this, create a blank text file called 'userdata.txt' , make sure it is ALL
    LOWER-CASE. Edit this file and put
    '**username|##|password|##|email|##|rank|##|userid|##|name|##|picture**'. This will not be
    used, however it will give you an idea of how the....
  4. Automatic Login
    in WinXP (5)
    Ever wanted to just turn on our computer and when you get back it's already on the desktop?
    (Rather then having to login at the welcome screen) Now some computer have this feature by default,
    but what if it gets broken, try this. On an Administrator account goto start >> Run, and type
    "control userpasswords2" (without the quotes) Uncheck the box that "Users must enter a Username and
    Password to use this computer", then press Ok. You will be prompted to enter a default user and
    their pasword, then next time you restart the computer it will automaticaly login to that....
  5. Simple Login In Visual Basic 6
    user interaction example trough login programm (5)
    First of all, I am NOT a programmer, this is something my friend taught me. It describes basic
    interaction with the user, while showing basic functionality of this simple programm. So, without
    further ado, we're off to the tutorial: First of all, start your visual basic, when prompted
    for new project, select Standard Exe . Next, we need to open code window, so we can start typing
    the program. This can be done in two ways, one is double clicking on the form, or selecting Code
    from View menu. If you double clicked on the form, you will see following text: CODE ....
  6. How To Put A Phpbb Login Box On Your Main Site.
    Code and .php included!!! (18)
    I have included my coded file with this... Ok here is the code. CODE // //Create login area,
    replace the phpBB2 in /phpBB2/login.php with your forum's //directory // <form
    action="/phpBB2/login.php" method="post" target="_top"> <table
    width="25%" cellspacing="2" cellpadding="2" border="0"
    align="center">  <tr> <td align="left"
    class="nav"><a href="/phpBB2/index.php" class="nav">Prank Place
    Forum Index</a></td>....
  7. Php/mysql Login/register
    Tutorial for login with databases. (2)
    Start register code. Register.php CODE <form method=post
    action=register.php?action=register  name=s> <table>
    <tr><td>Username:</td><td><input type=text
    name=user></td></tr>
    <tr><td>Email:</td><td><input type=text
    name=email></td></tr>
    <tr><td>Pass:</td><td><input type=password
    name=pass></td></tr> <tr><td>Verify
    Pass:</td><td><input ....
  8. Complete Login And Registration System
    doesn't use mysql! (9)
    kLogin 0.1 QUOTE(readme.txt) Readme file to kLogin 0.1 To use the internet explorer fix:
    download the latest IE7 ZIP file
    (http://sourceforge.net/project/showfiles.php?group_id=109983&package_id=119707) Extract the ie7
    zip file to the root directory of your web server. Example, if you are using a unix/linux server,
    it's on "public_html/" or "home/public_html" Open kLogin.php file with your editor and edit the
    $info_text or $info_txt variable. Then, extract the kLogin.php file in to the root
    directory of your web server also. Just run kShoutBo....
  9. Multiple Admin Login (php)
    This is a script that doesnt requre SQL (3)
    first off make a login.html page Code: QUOTE Admin Login Username: Password:
    then make a check.php page Code: QUOTE $admin1 = "admin1"; //
    first admin username $adm_pass1 = "password1"; // first admin password $admin2 =
    "admin2"; // second admin username $adm_pass2 = "password2"; // second admin password
    if(($username == $admin1 && $password == $adm_pass1) || ($username ==
    $admin2 && $password == $adm_pass2)){ echo "Congratulations " . $_POST . " ....
  10. Complete Login System
    With PHP + MYSQL (56)
    Its an complete login sistem made and tested by me and I think itwill be very usefull for people who
    are tryn to learn PHP. First, let's make register.php: CODE <?
    include("conn.php"); // create a file with all the database connections
    if($do_register){ // if the submit button were clicked if((!$name)
    || (!$email) || (!$age) || (!$login) ||
    (!$password) || (!$password2)){ print "You can't let
    any fields in blank....

    1. Looking for php, simple, login, learn, make, simple, login

Searching Video's for php, simple, login, learn, make, simple, login
advertisement



Php Simple Login Tutorial - Learn how to make a simple login!



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE