Click here to Skip to main content
12,453,672 members (78,756 online)
Rate this:
Please Sign up or sign in to vote.
See more: PHP
<?php <br mode="hold" /?>
Posted 14-Nov-12 20:19pm
Updated 14-Nov-12 21:31pm
enhzflep 15-Nov-12 3:25am
You want us to count lines for you?
Edit your question, indicate the line that has a problem in it.
Following that, actually ASK a question.
My 1.
CodingLover 15-Nov-12 3:42am
What you have on line 12?
Rate this: bad
Please Sign up or sign in to vote.

Solution 3


You have an | at the end so it says |). That's the issue. It expects another condition before the ), you don't have too many brackets.
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

Hi thanks it worked and gone through but the database connection now is the one giving an errors:
Unidentified variable username in C:wamp\Adulteducation\DatabaseConn.php on line 8
Unidentified variable password in C:wamp\Adulteducation\DatabaseConn.php on line 8
Unidentified variable host in C:wamp\Adulteducation\DatabaseConn.php on line 8
The numbers are the lines. Thanks, I will appreciate i am a novice to php so I am trying to learn.

1. 2. //Database connection
3. $db_host ="localhost";
4. $db_user ="root";
5. $db_password ="";
6. $db_database ="e-farmer portal";
8. $connection=mysql_connect($host,$username,$password);
9. mysql_select_db("smith auto") or die(mysql_error());
10. ?>
DinoRondelly 15-Nov-12 12:17pm
Where did you declare $host,$Username,$Password?

Unidentified variable username means that the variable username isnt declared.

If i had to guess if you changed line 8 to look like the line below it would work
$connection = mysql_connect($db_host,$db_user,$db_passowrd)
Rate this: bad
Please Sign up or sign in to vote.

Solution 5

DinoRondelly thanks but am I missing something on the code below, I am getting the error:
Parse error: syntax error, unexpected '[' in C:\wamp\www\AdultEducation\index.php on line 11

line 11 is the one in bold. Kindly assist. I appreciate the effort.

This page authenticate users before they can acccess their protected pages
only registered Consumers can login. The idea and the concept:
//Starting a session
echo 'Welcome to Farmer Broker';


//Connection to the Database
require ('');
//This code runs if the the form has been submitted
//Username and Password sent from the form

//To protect MySQL injection

//Retrieving information from the table
$sql="SELECT Username,Password,Status FROM Consumer
WHERE Username='$user' AND Password=password('$password')";
$row = mysql_fetch_array($result);

//Mysql num row is counting table row

//If result matched $username and $password, table row must be 1 row
header ("location:Verify.php");
header ("location:Home.php");}
//If the username and/or the password is wrong the error message is displayed
$msg="Invalid Username and/or Password";

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 15 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100