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
v2
Comments
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
 
good
Please Sign up or sign in to vote.

Solution 3

if(!$_POST['Username']|!$_POST['Password']|!$_POST['F_Name']|!$_POST['L_Name']|
    !$_POST['Gender']|!$_POST['year']|!$_POST['month']|!$_POST['day']|!$_POST['street']|
    !$_POST['City']|!$_POST['Code']|!$_POST['Country']|!$_POST['Email']|)

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.
  Permalink  
Rate this: bad
 
good
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";
7.
8. $connection=mysql_connect($host,$username,$password);
9. mysql_select_db("smith auto") or die(mysql_error());
10. ?>
  Permalink  
Comments
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
 
good
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:
http://www.phpeasystep.com/workshopview.php?id=6
*/
//Starting a session
session_start();
echo 'Welcome to Farmer Broker';

$_SESSION['username']=['username'];

//Connection to the Database
require ('DatabaseConn.inc.php');
//This code runs if the the form has been submitted
if(isset($_POST['submit'])){
//Username and Password sent from the form
$username=$_POST['Username'];
$password=$_POST['Password'];

//To protect MySQL injection
$user=stripslashes($user);
$passwd=stripslashes($password);
$user=mysql_real_escape_string($user);
$password=mysql_real_escape_string($password);

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

//Mysql num row is counting table row
$count=mysql_num_rows($result);

//If result matched $username and $password, table row must be 1 row
if($count==1){
if($row["Status"]=='Verify'){
header ("location:Verify.php");
}else{
header ("location:Home.php");}
}
else{
//If the username and/or the password is wrong the error message is displayed
$msg="Invalid Username and/or Password";
}
}
?>
  Permalink  

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