Educational tutorials www.villageparksource.com
Posts Tagged ‘Error’
Java Tutorial: Java For Beginners (Part 17): Try Catch & Exceptions
July 13th, 2012
phpmoz Looking at try catch, and throwing and catching exceptions. Official website phpacademy.org Support Forum http Follow us on Twitter! twitter.com
PHP MySQL Tutorial: Connect to a MySQL Database -HD-
November 29th, 2011
phpmoz Updated Download Link: fur.ly In this tutorial, you will learn how to connect to a MySQL database using PHP. Besure to SUBSCRIBE because there will be a new tutorial every week. Follow me on Twitter @RiverCityGraphx Like us on on facebook: on.fb.me Suggest tutorials at For project files, help forums, and more check out the website at http For business related inquires contact us at
PHP Tutorial: Install ReCaptcha -HD-
November 20th, 2011
phpmoz In this tutorial, you will learn how to install ReCaptcha to prevent form spam. Besure to SUBSCRIBE because there will be a new tutorial every week. Follow me on Twitter @RiverCityGraphx Like us on on facebook: on.fb.me Suggest tutorials at www.rivercitygraphix.com For project files, help forums, and more check out the website at http For business related inquires contact us at rivercitygraphix@yahoo.com
PHP MySQL Tutorial: Connect to a MySQL Database -HD-
November 9th, 2011
phpmoz Updated Download Link: ow.ly In this tutorial, you will learn how to connect to a MySQL database using PHP. Besure to SUBSCRIBE because there will be a new tutorial every week. Follow me on Twitter @RiverCityGraphx Like us on on facebook: on.fb.me Suggest tutorials at For project files, help forums, and more check out the website at http For business related inquires contact us at
PHP Basics: Common Errors (Part 3)
May 9th, 2011
phpmoz Common errors you may come across when programming, and the solutions.
PHP MySQL Tutorial: Connect to a MySQL Database -HD-
November 16th, 2010
phpmoz In this tutorial, you will learn how to connect to a MySQL database using PHP. Be sure to SUBSCRIBE because there will be a new tutorial every week. Suggest tutorials at www.rivercitygraphix.com For project files, help forums, and more check out the website at http
How to install PHP 5.2.8 in Windows Apache Server XP, Vista, Server 2003
October 30th, 2010
phpmoz Visit myownserver.info and read my notes before applying the fix listed in this tutorial. This tutorial explains how to install PHP 5.2.8 on your Apache 2.2.11 HTTP server and how to fix some of the dynamic library errors found when viewing the Apache error.log.
Extract and show data from Mysql Using PHP
October 28th, 2010
phpmoz Step by step info on how to write the php code and extract information from any table in your database.
Php Syntax Error In Logout Script!?
August 25th, 2009
phpmoz I have 4 scripts that make up a basic login system with registration. Everything works except logout.php. It gets this error:
Parse error: syntax error, unexpected T_VARIABLE in /home/a9161210/public_html/logout.php on line 1
LOGOUT.PHP:
Login.php:
<?php
mysql_connect("mysql3.000webhost.com", "a9161210_login", "dualpower1") or die(mysql_error());
mysql_select_db("a9161210_login") or die(mysql_error());
//Checks if there is a login cookie
if(isset($_COOKIE['ID_my_site']))
//if there is, it logs you in and directes you to the members page
{
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{
if ($pass != $info['password'])
{
}
else
{
header("Location: members.php");
}
}
}
//if the login form is submitted
if (isset($_POST['submit'])) {
// makes sure they filled it in
if(!$_POST['username'] | !$_POST['pass']) {
die('You did not fill in a required field.');
}
// checks it against the database
if (!get_magic_quotes_gpc()) {
$_POST['email'] = addslashes($_POST['email']);
}
$check = mysql_query("SELECT * FROM users WHERE username = '".$_POST['username']."'")or die(mysql_error());
//Gives error if user dosen't exist
$check2 = mysql_num_rows($check);
if ($check2 == 0) {
die('An error occured please try again, or Click Here to Register ‘);
}
while($info = mysql_fetch_array( $check ))
{
$_POST['pass'] = stripslashes($_POST['pass']);
$info['password'] = stripslashes($info['password']);
$_POST['pass'] = md5($_POST['pass']);
//gives error if the password is wrong
if ($_POST['pass'] != $info['password']) {
die(‘An error occured please try again, or Click Here to Register ‘);
}
else
{
// if login is ok then we add a cookie
$_POST['username'] = stripslashes($_POST['username']);
$hour = time() + 3600;
setcookie(ID_my_site, $_POST['username'], $hour);
setcookie(Key_my_site, $_POST['pass'], $hour);
//then redirect them to the members area
header(“Location: members.php”);
}
}
}
else
{
// if they are not logged in
?>
<form action="” method=”post”>
Login |
|
| Username: | |
| Password: | |
Register.php:
Registered
Thank you, you have registered – you may now login.
<form action="” method=”post”>
| Username: | |
| Password: | |
| Confirm Password: | |
members.php:
<?php
mysql

Posted in
Tags:

