An Ongoing PHP & MySQL Tutorial Thread by JD Walker

:hmm:

If yousa Africanized sandal and high water corduroy wearin' craigslist scammin' ass muthafucka who believes PHP can be learned in 24 hours, get the fuck out of my thread.


sesame-street-oscar.jpg
 
It occurred to me that there are more than a few of you kats on the board with a genuine interest in dynamic web development beyond out the box CMSs and Forums. PHP is the foundation of dynamic web development.

It is also becoming more and more obvious that there are a slew of fraudulent ass clowns disseminating piss poor information about web development, such as writing half assed code, relying soley on GUIs and having you spend money on hacks from India. Janitor type niggas passing themselves off as web authorities. Vegas hookers workin' in Best Buy trying to get you hooked on GUIs. Black ass niggas who thinks building computers makes them experts on all things code.

I have over a decade of web programming under my belt. In this thread I'm not going to take tutorials from other books and post them as if they were mine. We're gonna get code FROM SCRATCH.

Control the source code, control EVERYTHING. Why is it imperative that you rookies know line for line what your code does? You hear the term "Programming Language". It's just that, a LANGUAGE. Imagine going through life not understanding the English language (I believe most of you don't, but that's for another thread). Imagine you had an idea for a story. You can't understand English so you hire an assclown from India to write it for you. How do you know if in fact he's writing your story? How do you know he's using proper grammar? How do you know? You don't. Control your code, CONTROL YOUR IDEA!

If you are one of these algebra flunkin ass niggas, get out of my thread. If you are one of the Colin Powell type niggas, leave my thread. If yousa Best Buy Janitor ass nigga, get out of my thread. If yousa whining ass "it's too hard" type nigga, leave my thread. If you don't understand f(y) = 2xy get out. If you from the south, get outa my thread. If you're a faggot, leave my thread immediately. If yousa bitch nigga, get the fuck outa my thread.

I'm not doing this for the community. I don't give a fuck about the kids nor I don't care about the inner city negroid. There ain't enough Black developers out there, and there is no excuse.

This thread is for kats who are serious. I'm going to cut some years off your learning curve. Now this thread is meant as a SUPPLEMENT to php.net and whatever books you buy. I'm here to break shit down to layman's/real world terms for you to gain a better understanding. That doesn't mean that you are exempt from learning from php.net, that is mandatory. Now while my knowledge of PHP is advanced, there are levels way above advance, so I don't know EVERYTHING about PHP, but I sure as hell know more than enough to put you up on "Markus Frind" type game (look him up).

Through out the day today I'll be covering:
What is PHP
How to Install PHP
How to install MySQL
Procedural vs. OOP
MVC framework
Variables.

Software needed for this ongoing tutorial:
PHP
MySQL
phpmyadmin

An advanced text editor such as Notepadd++, Coda, Textmate, or Dreamweaver.


How come you are being nice, is someone giving you free pussy?
 
Variables

Here is the Variables manual from php.net: http://php.net/manual/en/language.variables.php


I will supplement the manual by breaking things down in to layman's talk of course and how I will be using variables.

What is a variable?

Look at a variable as a container. You can store strings and values in that container.

Rules for making a (container) variable

in PHP, variables must start with a $ sign followed by either a letter or an underscore.

PHP:
$bgol = 'this is bgol'; // proper use
$_bgol = 'this is bgol'; // improper, only reserved for super global variables
$4bgol = 'this is bgol'; //not valid starts with a number

What can be stored in a variable?

PHP:
$bgol = 'this is bgol'; // A string
$bgol = 2 * 7; //A calculation
$bgol = 2 * 7 . ' this is bgol'; // a calculation and a string

You can combine variables...
PHP:
$bgol = 'this is bgol ';
$math = 2 * 7;
$results = $bgol . $math;

echo $results; //this is bgol 14

But you can't ADD a string to a numerical value...
PHP:
$bgol = 'this is bgol ';
$math = 2 * 7;
$results = $bgol + $math;

echo $results; // 14

You can store multiple values in one variable by making an ARRAY...
PHP:
$bgol = array(
   'string' => 'this is bgol',
   'math' => 2*7,
);

echo $bgol['string'], $bgol['math']; //Outputs: this is bgol 14



Next time I'll be covering:
Arrays
includes
Super Globals
SECURITY
And the first tutorial.
 
Last edited:
Arrays.

Here's the formal Array manual from php.net: http://php.net/manual/en/language.types.array.php

I was going to post my own explanation of arrays but I found a site that uses them just like I use them. So let's get started...

Arrays are special data types. Despite of other normal variables an array can store more than one value. Let's suppose you want to store basic colors in your PHP script. You can construct a small list from them like this:

Color list:

* red
* green
* blue
* balck
* white

It is quite hard, boring, and *bad idea to store each color in a separate variable. It would be very nice to have the above representation almost as it is in PHP. And here comes array into play.

The array type exists exactly for such purposes. So let's see how to create an array to store our color list.

*What the author means is that it would be a bad idea to do the following:

PHP:
<?php
   $red = red;
   $green = green;
   $blue = blue;
   $black black;
   $white = white;
?>

You're code can get messy real quick...

There are more ways to create an array in PHP. Maybe the most easiest way to create our color list array is the following:

Code:

PHP:
     $colorList = array("red","green","blue","black","white");


another solution is to *initialize array elements one-by-one as follows:

PHP:
      $colorList[0] = "red";
      $colorList[1] = "green";
      $colorList[2] = "blue";
      $colorList[3] = "black";
      $colorList[4] = "white";

If you don't want to bother about numbering - I will explain it later - you can create your array as this:

PHP:
      $colorList[] = "red";
      $colorList[] = "green";
      $colorList[] = "blue";
      $colorList[] = "black";
      $colorList[] = "white";

As you can see this is almost similar to the other but here we didn't write any number between the square brackets. In this case PHP makes the numbering internally from 0 to 4. This function is the so called auto-incremented keys.

*What is "initializing a variable"?

In order to use a variable, you have to first initialize it, which means ASSIGNING A VALUE TO IT. Even if that value is NULL. You must initialize variables before using them, if not, you will get error messages and leave yourself open for unpredictable behavior in your script and security attacks.

For example, of I were to print this line of code:

PHP:
   echo $sky;

I'd get the following error:
Code:
   Notice: Undefined variable: sky in /test.php on line 3

I must first assign a value to $sky, whether it's "''", NULL, a value, or a string.

In the last step we have created an array. It is not important which solution you choose the result is the same. It's nice but how you can use the data in the array. For example how to display the elements? There are more ways to do this. Let's see the possibilities.

If you want only display one element of the array then you can just write the following code:

PHP:
      echo $colorList[0];

This code will display the text "red". However you may want to display all elements in the array. You can write a *loop and display them like this:

PHP:
      for ($i=0;$i<=4;$i++){
         echo $colorList[$i];
      }

It is quite easy. However it is not the best solution as the number of element is hard coded. There is a much better way to display all elements of an array. You can use a foreach loop as this:

PHP:
      foreach ($colorList as $value) {
       echo $value;
      }


If you want to display array content for debugging purposes then you can use 2 built in PHP functions. These are the print_r and var_dump. These functions displays the array as key-value pairs. Besides this var_dump also displays variable information. You can use them as follows:

PHP:
      print_r($colorList);
      echo "";
      var_dump($colorList);

In the next step we will learn about associative arrays.


*I will cover loops indepth later on. This here

PHP:
      for ($i=0;$i<=4;$i++){
         echo $colorList[$i];
      }

can be optimized to the following:
PHP:
      for ($i=0;$i<=count($colorList);$i++){
         echo $colorList[$i];
      }


Debugging
We'll be doing a lot of this during the tutorial. Here's another method of variable dumping I use that's easier to read:

PHP:
   echo '<pre>', print_r($colorList), '</pre>';


In general PHP arrays are maps, which means that it is a type that maps values to keys. In our example it means that where the key is 0 there the value is "red" and where the key is 1 there the value is "green". However you have the possibility to use more meaningful keys. Associative array means that you can assign an arbitrary key to every value. Associative arrays are sometimes referred to as dictionaries. Our colorList array can be defined as associative array like this:

PHP:
      $colorList = array("apple"=>"red",
         "grass"=>"green",
         "sky"=>"blue",
         "night"=>"black",
         "wall"=>"white"
      );

You have to remember that array keys are case-sensitive, but type insensitive. It means that 'a' differs from 'A' but '1' is the same as 1.
So, the array above can be defined (created) one-by-one elements like this:

PHP:
      $colorList["apple"] = "red";
      $colorList["grass"] = "green";
      $colorList["sky"] = "blue";
      $colorList["night"] = "black";
      $colorList["wall"] = "white";

And you can display the content similar to the normal array, but here you need to use the string value instead of the number.

PHP:
      echo "The sky is ".$colorList["sky"]
      ." and the grass is ".$colorList["grass"];

You can mix your array and use numbers and strings in the same list like this:

PHP:
      $colorList["apple"] = "red";
      $colorList[5] = "green";
      $colorList["sky"] = "blue";
      $colorList["night"] = "black";
      $colorList[22] = "white";

As you can see even the numbers can be any so you don't have to make it continuous. However be aware of using such mixed arrays as it can result errors.


*String Values
I use single quotes instead of double quotes.
$colorList['night'] = $colorList["night"]

Also, the following
PHP:
      $colorList["apple"] = "red";
      $colorList[5] = "green";
      $colorList["sky"] = "blue";
      $colorList["night"] = "black";
      $colorList[22] = "white";

can be written like so

PHP:
     $colorList = array(
         'apple' => 'red', 
         '5' => 'green',
         'sky' => 'blue',
         'night' => 'black',
         '22' => 'white', 
     );


As each element value of the array can be any type it means that it can be other array as well. If an array element value is an other array then this is a multidimensional array. Of course the internal array values can be arrays as well and so on. You can define 10 dimensional (or more) array if you want.

Creating a multidimensional array is as almost simple as the normal array. Let's see an example:

PHP:
      $myLists['colors'] = array("apple"=>"red",
         "grass"=>"green",
         "sky"=>"blue",
         "night"=>"black",
         "wall"=>"white"
      );

      $myLists['cars'] = array("BMW"=>"M6",
         "Mercedes"=>"E 270 CDI",
         "Lexus"=>"IS 220d",
         "Mazda"=>"6",
         "Toyota"=>"Avensis"
      );

To acces and display an element in the multidimensional array you just extend the key list as follows:

PHP:
      echo $myLists['cars']['Toyota'];


Of course you can define normal, mixed and associative multidimensional arrays.


More about multidimensional arrays
You can take a multidimensional array as deep as you want.

let's use the following as an example...
PHP:
      $myLists['cars'] = array("BMW"=>"M6",
         "Mercedes"=>"E 270 CDI",
         "Lexus"=>"IS 220d",
         "Mazda"=>"6",
         "Toyota"=>"Avensis"
      );

What if each model had its own color?

PHP:
      $myLists['cars'] = array(
         'BMW' => 'M6', 
            array('colors' => 'red', 'green', 'yellow'),
         'Mercedes' =>'E 270 CDI', , 
            array('colors' => 'orange', 'blue', 'purple'),
         'Lexus' => 'IS 220d', 
            array('colors' => 'red', 'green', 'burgundy' =>
              array('light burgundy', 'dark burgundy'),
            ),
         'Mazda' => '6',
         'Toyota' => 'Avensis'
      );


This is how data is structures in PHP. Your user profiles on BGOL are structured in a similar fashion.
 
*String Values
I use single quotes instead of double quotes.
$colorList['night'] = $colorList["night"]

Brotha JD, as a rule of thumb I always use single quotes instead of double quotes. Especially since double quotes can mess ya up when mixing in HTML. What would you recommend for the young homies?
 
Brotha JD, as a rule of thumb I always use single quotes instead of double quotes. Especially since double quotes can mess ya up when mixing in HTML. What would you recommend for the young homies?

Single quotes. it has a slight performance edge over double quotes and you'll run in to fewer problems. A big reason why they aren't used as much is because a lot of developers get confused when they try to escape javascript of contractions.

For example, this is a basic html page with a javascript alert
HTML:
     <html>
      <head>
       <title>HTML Page</title>
       <script type="text/javascript">
         alert('This is a Javascript Alert');
       </script>
      </head>
      <body>
         <div>My English teacher told me I can't write sentences with contractions because it is improper.</div>
      </body>
     </html>

If I were to embed this in PHP like I always do WITHOUT escaping the single quotes in the javascript I'd get an error message. In PHP, single quotes signal the beginning and end of a string, so if you add a single quote without escaping it, PHP will think you are terminating that string. This is how you escape single quotes in PHP

PHP:
echo '
     <html>
      <head>
       <title>HTML Page</title>
       <script type="text/javascript">
         alert(\'This is a Javascript Alert\');
       </script>
      </head>
      <body>
         <div>My English teacher told me I can\'t write sentences with contractions because it is improper.</div>
      </body>
     </html>';

Notice I added backslashes to the beginning of each single quote I wanted escaped. Instead of PHP terminating at the beginning for the javascript alert, if terminates at the end of the HTML document like it's supposed to. Now in javascript, in most functions you can replace single quotes with double quotes which will eliminate escaping like so:

PHP:
echo '
     <html>
      <head>
       <title>HTML Page</title>
       <script type="text/javascript">
         alert("This is a Javascript Alert");
       </script>
      </head>
      <body>
         <div>My English teacher told me I can\'t write sentences with contractions because it is improper.</div>
      </body>
     </html>';
 
I asked a simple question to help give the homies a tip and this man got deep.

Pay attention everyone. JD is being very thorough and is providing excellent information.

<?php
echo 'Play on Playa!';
?>
 
Concatenation

concatenation |kənˌkatnˈā sh ən|
noun
a series of interconnected things or events

PHP:
<?php
   $a = 'I am ';
   $b = 'posting ';
   $c = 'on bgol today.'

   $d = $a . $b . $c;

   echo $d; // I am posting on bgol today.
?>

You will see me use to methods of concatenations. One with periods and one commas...

PHP:
<?php
   $a = 'I am ';
   $b = 'posting ';
   $c = 'on bgol today.'

   echo $a, $b, $c; // I am posting on bgol today.
?>

Commas provide better performance when echoing statement. The drawback to using commas is you can't assign the comma string to a variable.

You can do this:
PHP:
   echo $a . $b . $c;
   $d = $a . $b . $c;

and you can do this...
PHP:
   echo $a, $b, $c;

But you can't do this
PHP:
   $d = $a, $b, $c; //This will generate an error.
 
Constants

The PHP Manual on constants can be found here: http://php.net/manual/en/language.constants.php

What is a constant?

A constant is an identifier (name) for a simple value. As the name suggests, that value cannot change during the execution of the script (except for magic constants, which aren't actually constants). A constant is case-sensitive by default. By convention, constant identifiers are always uppercase.

constant |ˈkänstənt|
adjective
occurring continuously over a period of time : the pain is constant.
• remaining the same over a period of time : the company has kept its prices fairly constant.
• (of a person) unchangingly faithful and dependable.
See note at resolute .

Let's DEFINE a CONSTANT...

PHP:
   define('LEROY_SLAP_NUTZ','Is and forever will be a faggot.');

   echo LEROY_SLAP_NUTZ; // Outputs: Is and forever will be a faggot.

Note that you do not need a "$" infront of the constant when you are echoing it. I don't use constants really, not as much as I should be, so I'll add them to the tutorial later. They come in handy when you are defining a url.
 
include() and require()

Here is the PHP manual for include and require: http://php.net/manual/en/function.include.php

The include() statement includes and evaluates the specified file.

With includes, we can include files in to a script for optimized performance.

For example, let's make a file called "test.php" and enter the following inside that file

PHP:
<?php

   $color = 'blue';

?>

Now let's make a file called "index.php" and include the test.php and echo $color from within the index.php


PHP:
<?php

   include('test.php');

   echo $color; // Outputs: blue

?>


The difference between include and require is "require" will terminate the script if the included file can't be found while include will allow the script to run regardless.
 
Predefined Variables & Superglobals

The Manual for predefined and superglobals can be found here: http://www.php.net/manual/en/language.variables.superglobals.php

The superglobals we will primarily use are $_POST and $_GET.

$_POST fetches post data and $_GET fetches data contained in urls.

for those with HTML knowledge, I'm pretty sure you've written the following lines when making forms

HTML:
<form method="post" action="">
<!-- input fields -->
</form>

In layman's terms, "method="post"" tells the script to save and send the data to the server and make it available for retrieval using $_POST variables in PHP, or Javascript, or ASP, or JSP. All this happens in a blink of an eye (in most cases) and behind the scenes where we can't see (but we will see how all that works soon).

The $_GET variable retrieves data from dynamic urls (but it can also retrive data from forms, but not recommended)

Let's make up a url
Code:
http://bgol.com/index.php?action=delete;what=faggot;name=leroy

$_GET allows us to convert that url in to variables like so:

PHP:
   $action = delete;
   $what = faggot;
   $name = leroy;

Both these Superglobals are critical when sending commands to the model.
 
Installing PHP, MySQL, and phpMyAdmin on Linux and Windows

I don't know how to do either.

I'm assuming "LAMP" applies to Linux OS by default?

If there are any of you who have successfully installed and run PHP, MySQL, and phpMyAdmin on both these platforms it would be appreciated if you can offer a step to step installation guide like the one I provided for the Mac.

You're correct, LAMP Server = Linux Apachy MySQL PHP Server

Whenever I set up LAMP servers, I always use Ubuntu. Easiest by far.

Installing Ubuntu LAMP Server

1. Open terminal ( Applications > Accessories > Terminal )

2. Enter the following code:
Code:
sudo taskel install lamp-server

Alternatively to only install PHP5 enter the following code into the terminal:
Code:
sudo apt-get install php5

There is more info here, I just didn't want to clutter the thread.

Although, I suggest just installing the LAMP server. I have a few virtual machines that I use for set up, rarely do any of the programming. Good thread, will post info when I can. Will mainly be soaking up the info.
 
Last edited:
What I need is a good secured PHP login script that I can use at my workplace. I'd like something that has an interface so if an employee leaves the company I can disable their account. Don't really want to have to go into MySQL to delete the record. I've seen some examples on the net but some have been really buggy. Would like to use it with a template within Dreamweaver. Any ideas?
 
What I need is a good secured PHP login script that I can use at my workplace. I'd like something that has an interface so if an employee leaves the company I can disable their account. Don't really want to have to go into MySQL to delete the record. I've seen some examples on the net but some have been really buggy. Would like to use it with a template within Dreamweaver. Any ideas?

A template for the backend requirements you just described of an asthetic template? What you want is fairly simple and can be coded from scratch in a decent amount of time. I personally wouldn't rely on premade functions on dreamweaver.

I'm going to kick off the tutorial with a registration form very soon. Of course at some point I will also have to add a login form.
 
A friendly reminder... Stay the fuck out of my thread...

...if the following applies:
A faggot.
You are a single mother.
A Black bitch.
A lazy nigga who is always whining about things being too hard to learn.
A bitch made flash fuckboy.


Right now I'm looking at the message index. There are 52,977 so far registered to BGOL. It would be a safe assumption that maybe a few out of that 52,977 know PHP, maybe even more than I know. If during the tutorial you see me make a mistake or even give bad advice, please, correct me. But if you do so, please POST THE CORRECTION, MEANING POST THE CORRECT CODE. Don't run in her like bitchmade Flash stans hollerin about shit is wrong but now knowing why and not knowing WTF it is you are talking about.

now let's get started...
 
LESSON #1: A Registration Form

A lot of you surf the web, but that doesn't mean you know how it works. Most of you don't. But you will after the tutorial. We will start with what seems to be a basic registration form. What I will show you is what happens in the behind the scenes.

In your Sites folder, make a "tutorial" folder and follow this file and directory structure:

directories.png


OR

you can download it from here:
http://www.megaupload.com/?d=ODMZ58NE


What does this all mean?
directories.png


The directory and file structure sets our site up using the MVC framework. We have an "engine" folder. The files in this folder will handle all the heavy lifting of our web application. The "Template" folder contains the files that will make our web application look cool and easy to navigate.
 
LESSON #1: A Registration Form (cont.)

Let's break down the code in the Settings.php...

PHP:
define('url', 'http://127.0.0.1/directory_to_your/tutorial');

Here I defined a CONSTANT. The constant will be the url to our application. Since this will not change (unless you move it to another server) we make a constant out of it. In that line, make sure you enter the local url of your tutorial accordingly.

PHP:
$theme = array(
	'url' => url . '/Templates',
	'default' => array(
		'url' => url . '/Templates/default',
		'images' => url . '/Templates/default/images',
		'style' => url . '/Templates/default/style.css',
		),
	);

As you see, I made an array of urls we will be using through out this tutorial. We have the url of the Templates folder and urls of the default theme including the urls to the the style sheet and images.

Why not hard code the urls in to the template?
What if you change servers? Do you really want to run through all your files and templates to change the url or just change one line, which is define in the constant?

Why not use relative paths instead of urls?
You want your web application to be as flexible as possible. If you used relative urls and decided you want to chacnge your dynamic links in to SEF (Search Engine Friendly) urls, the relative paths will no longer point where they are suppose to thereby breaking your site.

Also not that I am using LITERAL descriptions in my variables.

You have to PLAN for everything.
 
LESSON #1: A Registration Form (cont.)

Let's check out the index.php...

PHP:
ob_start();
error_reporting(E_STRICT | E_ALL);
require_once('Settings.php');
include_once('Engine/Actions.php');
include_once('Engine/Functions.php');
include_once('Engine/Login.php');
include_once('Engine/Query.php');
include_once('Templates/default/IndexTemplate.php');
ob_flush();

This probably deviates from what you are normally used too, which is seeing the HTML markup on the index file of the root directory.

You probably also noticed that I placed blank index.php files in all the directories. This is a SECURITY MEASURE protecting the directory files from being listed in the event someone gets curious for malicious reason. Throughout this tutorial I will see if you kats are playing attention and intentionally leave some things unguarded.


PHP:
ob_start();

ob_flush();

I'm not going to delve in to Output Buffering yet, that's for later down the line. The reason why they were included in this file is to make it a little easier for us to debug our code.

PHP:
error_reporting(E_STRICT | E_ALL);

PHP comes with built in error reporting. It's very good and very unforgiving, which is very good. During the building phase of your web application you it should ALWAYS be turned on. After you've completed your site, you should turn it off. Keeping it on could pose a potential security risk.

PHP:
require_once('Settings.php');
include_once('Engine/Actions.php');
include_once('Engine/Functions.php');
include_once('Engine/Login.php');
include_once('Engine/Query.php');
include_once('Templates/default/IndexTemplate.php');

Here I included all the files that will be necessary to drive out web app.
 
LESSON #1: A Registration Form (cont.)

The Template/default/IndexTemplate.php is pretty self explanatory. I'm operating under the assumption that those of you following this tutorial have a little HTML and CSS under your belts. Hoever you probably notice 2 things:

1) I embedded HTML inside PHP
2) I used the theme variable to set the path the the style sheet.

If you are using a GUI for this tutorial, it won't work. GUIs have trouble recognizing HTML embedded in to PHP.

Now that the basics are explained, when you load the http://127.0.0.1/directory_to_your/tutorial

you should see the following:
registration.png


IE disclaimer:
I don't care if rounded corners don't render properly in IE. Fuck IE. As a matter of fact, later on, we will use IE's weaknesses to make a browser detection function in PHP.
 
LESSON #1: A Registration Form (cont.)

So what we'll do now is check out the HTML Markup of the above posted registration form.

HTML:
                <form method="post" action="">
                    <fieldset><legend>Register</legend>
                        <label for="name">Name</label><input type="text" name="name" id="name" />
                        <br />
                        <label for="email">Email</label><input type="text" name="email" id="email" />
                        <br />
                        <label for="password">Password</label><input type="password" name="password" id="password" />
                        <br /><br />
                        <input type="submit" name="register" value="Submit" />
                    </fieldset>
                </form>

In the form attribute you see "method="post". This is critical, this tells the form to send the inputed form data to the server and prep it for use (HTTP POST REQUEST). The name attributes you see in the input lines collects the information types in the the respective form fields.

So what is does this data look like that's getting posted to the server?

In the Engine/Process.php, we will enter the following line:

PHP:
echo '<pre>', print_r($_POST), '</pre>';

The print_r function will return an array of what's going on behind the scenes. Save the file, and click the submit button on the form. What you should see is the following:
r2.png


You see the keys in the array. Those come from the form in the HTML markup. They are empty expect the registration key, because we did click "Submit" after all. So what will this look like when I fill out the name, email, and password?

reg3.png


Next we'll figure out what to do with those values...
 
Can an option be added where if the user forgets their password they can fill out a form or does the script email them their password. Also can the script give them an opportunity to change their password or will they have to contact IT to change it? If I remember correctly I've seen some passwords stored as md5 format. Sorry if I'm jumping ahead. I really need to understand this because I need to implement this at work right away.
 
Can an option be added where if the user forgets their password they can fill out a form or does the script email them their password. Also can the script give them an opportunity to change their password or will they have to contact IT to change it?

This is easy, but I'm not going to promise to cover it in this tutorial

If I remember correctly I've seen some passwords stored as md5 format. Sorry if I'm jumping ahead. I really need to understand this because I need to implement this at work right away.

md5 isn't safe anymore, salted sha encryption is pretty much the standard these days.
 
Back
Top