Welcome To TutorialBase
Please feel free to Browse our tutorials. Just selet a catagory down the side, and take a look through our tutorials. By '.$row['creator'].' in '.$row['category'].'';
echo '
'.$row['description'].'
Thank you for loggin in. Click here to return to the index.
';
}
else
{
// Login not successful
echo "Sorry, could not log you in. Wrong login information.
";
}
}
else
{
//If all went right the Web form appears and users can log in
echo '";
}
}
} elseif ($_GET['action'] == 'register' ){
if ( $_GET["op"] == "reg" )
{
$bInputFlag = false;
foreach ( $_POST as $field )
{
if ($field == "")
{
$bInputFlag = false;
}
else
{
$bInputFlag = true;
}
}
// If we had problems with the input, exit with error
if ($bInputFlag == false)
{
die( "Problem with your registration info. "
."Please go back and try again.");
}
$username = mysql_real_escape_string($_POST["username"]);
$password = mysql_real_escape_string($_POST["password"]);
$email = mysql_real_escape_string($_POST["email"]);
$q = "INSERT INTO `dbusers` (`username`,`passw`,`email`) "
."VALUES ('".$username."', "
." PASSWORD('".$password."'), "
."'".$email."')";
$r = mysql_query($q);
if ( !mysql_insert_id() )
{
die("Error: User not added to database.");
}
else
{
echo "Thanks for registering!
"; } } else { echo '"; } } elseif ($_GET['action'] == 'logout' ){ session_start(); session_unset(); session_destroy(); echo 'Thank you for your stay. Click here to return to the index.'; } elseif ($_GET['action'] == 'submit' ) { if ($_SESSION["valid_user"]) { ?>
Submit a tutorial
'.$row['tutorialname'].' By '.$row['creator'].' in '.$row['category'].'';
echo '
'.$row['description'].'
