what is wrong in this

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Naeem
Forum Commoner
Posts: 31
Joined: Tue Jul 07, 2009 12:48 pm

what is wrong in this

Post by Naeem »

what is wrong in this i couldn't find any mistake in this it's give me this error.
Parse error: parse error, unexpected T_STRING in C:\EasyWAMP\www\funapnaapna\inc\functions.php on line 4
here is the code:

Code: Select all

<?php
session_start();
include("../inc/connection.php");
include("../inc/functions.php");
$username = cleanString($_POST['username']);
$password = cleanString(md5($_POST['password']));
$checking_admin_account = ("SELECT admin_username,admin_password FROM administrator WHERE admin_username = '$username' AND admin_password = '$password' ");
$retrieving_admin_account = mysql_query($checking_admin_account);
$$retrieving_admin_account_row = mysql_num_rows($retrieving_admin_account);
if($retrieving_admin_account_row == 1){
    $_SESSION['username'] == $username;
    $_SESSION['loggedin'] == "loggedin";
    header("Location: index.php");
} else {
    $common_error("Wrong Username OR Password");
}
?>
And this is functions.php file

Code: Select all

<?php
function cleanString($clstr)
{
    $cstr = trim($clstr);
    $cstr = htmlspecialchars($cstr);
    $cstr = addslashes($cstr);
    return $cstr;
}
?>
User avatar
markusn00b
Forum Contributor
Posts: 298
Joined: Sat Oct 20, 2007 2:16 pm
Location: York, England

Re: what is wrong in this

Post by markusn00b »

Very strange - I don't see an error either.. nor does PHP pick it up.
Post Reply