Skip to content
Advertisement

Go to a precedent page in a php site

I’m creating a simple php program and I’m trying to find a way to be able to go from the page 2 back to the page 1 with a button. I tried by making a button in the second page and giving it the value 1 but it gives me error with the user. How can I do it?

JavaScript

Advertisement

Answer

So, reading your code, on your ‘page 2’, you have this form:

JavaScript

And your if-else states:

JavaScript

So your session values utente and pwd are replaced by the posted ones, but they aren’t posted by your ‘page 2’.

Once a user is logged in, and the session values are set, you can also create hyperlinks instead of forms to navigate between pages. But I don’t understand your goal completely. Create other questions for that.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement