Script: www.developphp.com Part 4 of MySQL PHP Search Programming Exercises for database driven web sites. Search pages that allow advanced targeting and filtering of information. Learn to build HTML Search Forms and Advanced Search Filters, Various MySQL Search Query Methods, Joined Table Queries Targeting Multiple Tables, Natural Language Full-Text Search Queries and discuss fine tuning your search programming and adjusting search parameters.
Posts Tagged ‘Syntax’
4. MySQL PHP Search Programming : SQL MATCH AGAINST Fulltext Search Syntax UNION Tutorial
November 17th, 2011
phpmoz 3. MySQL PHP Search Programming : SQL LIKE Syntax UNION and AS Alias with Filters Tutorial
November 17th, 2011
phpmoz Script: www.developphp.com Part 3 of MySQL PHP Search Programming Exercises for database driven web sites. Search pages that allow advanced targeting and filtering of information. Learn to build HTML Search Forms and Advanced Search Filters, Various MySQL Search Query Methods, Joined Table Queries Targeting Multiple Tables, Natural Language Full-Text Search Queries and discuss fine tuning your search programming and adjusting search parameters.
3. MySQL PHP Search Programming : SQL LIKE Syntax UNION and AS Alias with Filters Tutorial
November 17th, 2011
phpmoz Script: www.developphp.com Part 3 of MySQL PHP Search Programming Exercises for database driven web sites. Search pages that allow advanced targeting and filtering of information. Learn to build HTML Search Forms and Advanced Search Filters, Various MySQL Search Query Methods, Joined Table Queries Targeting Multiple Tables, Natural Language Full-Text Search Queries and discuss fine tuning your search programming and adjusting search parameters.
PHP Tutorial Part 1, intro and variables
October 29th, 2011
phpmoz php tutorial about the basic and intermediate syntax. Part 1 of 10. Covering: – data types and variables — string, integer, boolean, arrays WAMP: www.wampserver.com/en/ PHP Docs: www.php.net
PHP Tutorial 5 – Conditional Statements
January 31st, 2010
phpmoz Language: PHP Assumed knowledge: HTML, CSS Software required: PHP, mysql and Apache Topics covered: If, elseif, else statements and alternative syntax
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:

