Jeigh
Apr 22 2008, 05:43 PM
| | I assume the md5 function is just an encryption technique? I know another option is to use the sha1() encryption that seems to do a good job. Not sure if either has a vast benefit over the other or not but figured it was worth mentioning lol |
Reply
jlhaslip
Apr 24 2008, 03:55 AM
http://php.net/requirehttp://php.net/includethe biggest difference between require() and include() is that require() will throw a fatal error and stop the script if there is an error with the file or the path to the file. it is used when the "required" file is critical to the script functioning, like the DB connection script. If the connection script is not available, stopping the process is a good idea.
Reply
FirefoxRocks
Apr 24 2008, 04:29 AM
This is a very nice tutorial for a login script. I haven't read through it thoroughly but I have skimmed through various sections and it looks a bit more secure than the one that I use currently. One thing though, what's the difference between require() and require_once()? It seems that both are putting the file in once, so why use require_once()?
Reply
Mordent
Apr 24 2008, 03:46 PM
QUOTE(Jeigh @ Apr 22 2008, 06:43 PM)  I assume the md5 function is just an encryption technique? I know another option is to use the sha1() encryption that seems to do a good job. Not sure if either has a vast benefit over the other or not but figured it was worth mentioning lol You assume right, although I'm not aware of the benefits of one over another either. Personally I use md5(), simply because it was the one I saw first, I guess. If one was substantially better than the other I'd imagine that there'd be more awareness on the subject. QUOTE(FirefoxRocks @ Apr 24 2008, 05:29 AM)  ...
One thing though, what's the difference between require() and require_once()? It seems that both are putting the file in once, so why use require_once()? require() will get the required file each and every time. require_once() will only ever get the required file once in a page, so if it's been required before it won't be done so again. Personally I find this useful for things like database connection includes, as although you may have various different spots where you want to connect to a database in your script, there's no need to connect more than once. The first time the file is required, the database would be connected to. All times after that nothing would happen, and assuming you haven't closed the previous connection for whatever reason then all other database queries will run off of the first one. In my opinion, if possible you should use require_once() in preference to require(), even if you only use the require once on the page. It just seems like neater code to me, but that's just the way I am. Overall, not a bad little login script. I had great fun writing my own one a little while back, and once you've cracked your first one the rest do tend to fall in to place a lot quicker. It made for a great opportunity to practice using mysql functions and whatnot as well, and isn't too difficult technically, so I reckon it's not a bad little thing for PHP programmers who've got their heads around the very basics to have a crack at.
Reply
Feelay
Apr 24 2008, 04:18 PM
It was a really long time ago I created a php-script  So I have forgotten most of the codes  I really have to make a comeback  but I am starting to find it kinda boring  Thanks for the comments and tips //Feelay
Reply
Ddraiggoch06
May 22 2008, 05:07 PM
Very nice tutorial. Easy to understand and written for the beginner (like me  ). I'll try this out sometime, I've always wanted to have a go at a login system. Simple but effective
Reply
mafialeg
May 24 2008, 06:41 PM
Nice, really like it
Reply
maxmumford
Jun 26 2008, 10:56 PM
Hi =] nice tutorial - its so useful having so many notes too. any idea why im getting this error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in login2.php on line 18 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in login2.php on line 25 Wrong Username or Password ? Thanks  Max
Reply
kanade
Jun 28 2008, 02:46 PM
QUOTE(Feelay @ Apr 22 2008, 08:17 PM)  I use require_once when I want to "include" something, but not exactly include it.. it is hard to explain.. I just know, that when you want to check a database file, or something like it, it is better to use the require function instead of include. include is better to use when you want to include a part of a page.
BTW: Sorry for the late answere :P Nice toutorial, this is verry usefull script and lot of new things to learn. But it will be more usefull if any one explains the script in more details and with some more comments for the script.
Reply
Recent Queries:--
simple php code "login script" - 118.94 hr back. (1)
-
php login script on w3school - 250.73 hr back. (1)
-
logonscript blocker - 415.81 hr back. (1)
Similar Topics
Keywords : login script secure login script- PHP: Writing A Generic Login And Register Script
- (15)
Now there are basically 3 functions that a user management system provides: login, register, and
protection. A user management system can do more than this but that is all that this tutorial will
be covering. I will try to explain what I am doing as I go along but to fully understand what is
happening you should have a basic knowledge of PHP, SQL, and HTML. This tutorial assumes you are
using MySQL, adjust accordingly for a different DBMS. First off lets define the database table
where our users will be stored. Using phpMyAdmin run this statement to create our table...
A Simple Register Script
- This Is a Very Simple Register-Script (3)
Some time ago, i made a login-script. But how do you use a login-script, if you can't register.
So this morning, I decided to make a register-script.. What you should already know: The php
basics and a little more. How to use php and mysql together. The HTML basics (to make the forms).
The first thing we should do, is creating the database tables. Here is the code: CODE CREATE
TABLE `user` ( `id` int(4) unsigned NOT NULL auto_increment, `username` varchar(32) NOT NULL,
`password` varchar(32) NOT NULL, `level` int(4) default '1', PRIMARY K...
PHP Tutorial: Form Verification And Simple Validation
- A One Page script for PHP form verification. (12)
Having used various means of verifying HTML forms I believe that this method of verifying a form
to be the best mostly because it does everything on one page. It presents the form on one page and
then when the submit button is pressed, if all the required fields are not filled out then it will
present the form again with all the fields intact and in red lettering will point out the fields
that are required to be filled out in red. It is not possible to click submit using this method even
if the user has turned JavaScript off. While it is possible to use javascript to ...
Creating A Php Login Script
- A thorough look at the process behind it (3)
Attack Script In Php
- This is a funny attack script that i made (5)
Hey! I am going to share an attack script that i made for some time ago. I made it, as a test for
my game.. And ofc, you can use it for your game to. It is still version 1.0. But I want you to learn
something from it /wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
This is my second tutorial here, and I will try to make it better than my first one /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Here is the SQL File.
CODE CREATE TABLE `characterss` ( `health` int(200) NOT NULL default '10...
Simple User Validation Script
- (5)
This tutorial will show you how to create a simple user validation script with PHP. We will need
two files: "protect.php" and "login.php". The protect file is not meant to be viewed by itself. In
order to protect a page, you need to include that file by using PHP code like the following: CODE
include("protect.php"); Keep in mind that this needs to be in between your tags. This bit of
code uses the include function. It is a handy function that reads all the information contained in
one file and temporarily adds it to another. For example, this can be used to cr...
Creating Your Own Image Gallery With Php
- A Guideline, Not A Complete Script (3)
Recently a member asked how to create a photo gallery using his various directories filled with
image files. Here is an overview of the steps and fuctions needed to do this. Assuming that the
following directories exists and are full of image files: www.testsite.web/photos/gallery1/
www.testsite.web/photos/gallery2/ www.testsite.web/pictures/album1/ In order to get the contents
for a specific gallery you'll need to let the script know which one to look in. You'll need
to use a link that carries the arguments needed to locate the right photos. www.testsite.we...
Secure Php Coding
- tips and hints for more secure PHP'ing (10)
Secure PHP coding Today, PHP is a very common and very popular scripting language that is used
by many people over the world. However, many php scripts that they make are vulnerable to
'hacks' by leaving some security holes open. This article will explain how someone can abuse
your script and can alter your site/files, but also (even more important), this article will tell
you how to PREVENT your site from being hacked and how to spot and fix those security holes.
Contents: - Chapter 1 : To serve or not to serve - Chapter 2 : MySql, friend or foe? - Conclu...
PHP Tutorial: Menu Or Sidebar Script For CMS101
- and other applications as well (6)
A Php Menu-builder Tutorial This Sidebar Menu-builder code and the php scripts are adapted from
a Tutorial on the Astahost.com Forum titled : CMS101 - Content Management System Design .
Since the original tutorial's author (vujsa) did such a marvellous job of describing the system
in the original Topic posting, I will not attempt to explain it here, rather, I invite you to have a
look at his Topic and learn from it. The Basic tutorial provided coding for developing a table-based
web-site template which used php includes and embedded data to create a &...
Looking for simple, login, script, simple, secure, login, script
|
*SIMILAR VIDEOS*
Searching Video's for simple, login, script, simple, secure, login, script
|
advertisement
|
|