Hi,
There is a Login Page/form which when submitted invokes a php file "get_valid_user.php".
If the user is not valid then "get_valid_user.php" echoes the message that "Invalid/Incorrect Username or Password".
My requirement is to display this error message inside a particular cell (Row3-Col1) of the table as shown in the attached file.
How do we do this?
Thanks.
Error Display
Moderator: General Moderators
Error Display
- Attachments
-
- untitled.GIF (2.97 KiB) Viewed 165 times
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Error Display
Use an if statement to display and addition row and colspan
Re: Error Display
But let's say the row is already there and I just need to display the error inside the first cell of 3rd Row.aceconcepts wrote:Use an if statement to display and addition row and colspan
Is it possible?
Thanks,
Re: Error Display
Have you tried to do it?php14user wrote:Is it possible?
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Error Display
Sure, just check if there is an error and echo a message.
Re: Error Display
I am not sure what to do actually...aceconcepts wrote:Sure, just check if there is an error and echo a message.
When I open login page, table gets created as shown in the attachment of my first mail.
The Last row is kept empty to fill the error message if invalid user tries to log in.
I would like to display the error message in the 3rd Row (colspan =4).
I am using another php file "get_valid_user.php" to validate the user and echo the message onto Login Page inside the specified cell.
Please help.
Thanks
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Error Display
What you could do to make life simple is set the form action="".
At the top of your first page include the validation file
e.g.
Pretty crude but hope it helps
At the top of your first page include the validation file
e.g.
Code: Select all
//PAGE 1
//check if the form has been submitted - if so then call the validation script
if(isset($_POST['submitForm']))
{
include("get_valid_user.php");
}
//display the form
<form method="post" action="">
//input fields
//if error exists then display it
if($loginErr==1)
{
echo'Invalid username and/or password';
}
//submitForm button
</form>
//Page 2 - this will be your validation script
$loginErr=0;
//if login is incorrect then $loginErr=1;