Welcome To TutorialBase

Please feel free to Browse our tutorials. Just selet a catagory down the side, and take a look through our tutorials.
'.$row['tutorialname'].'

By '.$row['creator'].' in '.$row['category'].''; echo '
'.$row['description'].'

'; } class display { function pagination($rows, $per_page, $current_page, $page_link) { global $core,$C; $this->pages = ceil($rows / $per_page); if($this->pages == 1) { return; } $output = "Pages: "; // Should we show the FIRST PAGE link? if($current_page > 2) { $output .= "<<"; } // Should we show the PREVIOUS PAGE link? if($current_page > 1) { $previous_page = $current_page - 1; $output .= " page=". $previous_page ."/\" title=\"Previous Page\"><"; } // Current Page Number $output .= "[ ". $current_page ." ]"; // Should we show the NEXT PAGE link? if($current_page < $this->pages) { $next_page = $current_page + 1; $output .= ">"; } // Should we show the LAST PAGE link? if($current_page < $this->pages - 1) { $output .= " >>"; } // Return the output. return $output; } } $display = new display; echo $display->pagination($articles_in_db, $articles_per_page, $current_page, $install_adress); } elseif ($_GET['action'] == 'login' ) { if ($_SESSION["valid_user"]) { echo 'You are already loged in Click here to return to the index.'; } else { if ($_GET["op"] == "login") { if (!$_POST["username"] || !$_POST["password"]) { die("You need to provide a username and password."); } $username = mysql_real_escape_string($_POST["username"]); $password = mysql_real_escape_string($_POST["password"]); // Create query $q = "SELECT * FROM `dbusers` " ."WHERE username='".$username."' " ."AND passw= '".$password."' " ."LIMIT 1"; // Run query $r = mysql_query($q); if ( $obj = @mysql_fetch_object($r) ) { // Login good, create session variables $_SESSION["valid_id"] = $obj->id; $_SESSION["valid_user"] = $_POST["username"]; $_SESSION["valid_time"] = time(); // Redirect to member page echo '
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 '
* Indicates required field

Log In

'; echo ""; echo ""; echo ""; 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 '
* Indicates required field

Log In

'; echo "
\n"; echo "
\n"; echo "
\n"; echo "\n"; 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

Tutorial Details:








http//



http://




'.$row['tutorialname'].'

By '.$row['creator'].' in '.$row['category'].''; echo '
'.$row['description'].'

'; $i++; } } ?>
FarCry - Mollio