here's the scripts in their most recent form.
<--------------login.php----------------->
<?php
include '../includes/conn.php.inc';
//create login form
echo "<table><form=\"http://photography.ronhnelson.com/index.php?linkID=6\" method=\"post\">";
echo "<tr><td>Username:</td>";
echo "<td><input type=\"text\" name=\"username\" /></td>";
echo "</tr>";
echo "<tr>";
echo "<td>Password:</td>";
echo "<td><input type=\"password\" name=\"password\" /></td>";
echo "</tr>";
echo "<tr>";
echo "<td><input type=\"submit\" name=\"submit\" value=\"Submit\" /></td>";
echo "<td><input type=\"reset\" name=\"reset\" value=\"Reset\" /></td>";
echo "</tr>";
echo "</form>";
echo "</table>";
?>
<-------------------index.php----------->
<?php
//new start for milestone four with php and databases
include 'includes/conn.php.inc';
echo "<div id=\"content\">";
echo "<div id=\"header\">";
echo "<img src=\"http://photography.ronhnelson.com/includes/head.php.inc\" alt=\"php gd created image\" />";
echo "</div>";
require_once 'includes/link.php.inc';
//require_once 'includes/pages.php';
$id = $_GET['linkID'];
$sql = "SELECT * FROM tblLink WHERE link_ID='$id'";
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{
?>
<?php
while($row = mysql_fetch_array($result))
{
include $row['Path'];
}
} else {
include 'http://photography.ronhnelson.com/index2.php';
}
echo "<br /><br /><br />";
echo "<div id=\"footer\">";
require_once 'includes/footer.php.inc';
echo "</div>";
echo "</div>";
?>
<-------------------checkuser.php which is linkID=6-------->
<?php
//declare variables
$username = $_POST['username'];
$password = md5($_POST['password']);
$submit = $_POST['submit'];
if((isset($username)) && (isset($password))) {
$sql = "SELECT * FROM tblPhotographer WHERE Uname='$user' AND Pword='$pass'";
//echo $sql;
//echo "<br />";
$result = mysql_query($sql)or die(mysql_error());
if(mysql_num_rows($result) > 0) {
while($row = mysql_fetch_array($result)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
// Register some session variables!
session_register('FirstName');
$_SESSION['FirstName'] = $fname;
session_register('LastName');
$_SESSION['LastName'] = $lname;
session_register('Uname');
$_SESSION['Uname'] = $number;
session_register('Email');
$_SESSION['Email'] = $email;
session_register('photographer_id');
$_SESSION['photographer_id'] = $id;
header("Location: [url]http://photography.ronhnelson.com/index.php?linkID=7[/url]");
}
} else {
echo "you could not be logged in to the system. please contact your webmaster";
}
}
?>
I don't know why when the form is submitted, it doesn't really appear to go to the processing page.