user1622621
user1622621

Reputation: 43

php back navigation issue

I am building a php web app and I am having some trouble with the navigation. It seems the user have to hit back twice to get past one of my apparent traps. . .

Consider this situation. The user wants to upload a file with a description, so he hits upload and gets directed to the upload.php page. He fills out the form and submits the form to uploader.php. Uploader.php redirects him back to upload.php?yay=true. From here, he needs to hit back twice to get back to the page where he hit the upload button. Is there a clever way to keep track of which page he originally came from (this case, 2 pages back) or do i need to keep his navigation story in say the session variable?

I could also just redirect to the page from where the user hit the upload button, but this means that the back button will take him to the fileupload.php page instead of the page previously to the one that had the upload button.

Any help appriciated!

Upvotes: 0

Views: 169

Answers (1)

Muhammed Ahmed Baig
Muhammed Ahmed Baig

Reputation: 82

Simple after doing upload stuff, justt redirect him to the original page like

// do the upload stuff
header('location:the_page_name.php');//the page where user originaly came from

Upvotes: 1

Related Questions