I am focusing on a login system and that i want, I situation the consumer joined wrong username &lifier password to come back him towards the login page by having an error ("Wrong username or password" for instance)

Right now I am using 2 files: file # 1 - html - the login form that publish the username &lifier password to file for number two file number two - php - inspections the username &lifier password, just in case they match, redirect to another page else, shows a mistake message in page number two

I would like it to display the mistake message in page # 1.

I'll thank you for help

Guy Dor

You are able to collect the mistake message and hang it as being a session variable. This kind of session message is known as "expensive message".

Take a look at an identical question Help a Beginner with a PHP based Login System

The example on that question consists of a method to implement session based expensive message.

In my opinion the most popular method of doing this really is to achieve the login form reprint around the php page once you determine the login was wrong. Otherwise the first page would need to be considered a php too to ensure that you could do this the logic to show the warning after page 2 redirects to it.