php - how to control database update by going back and directly opening the link -
created 3 pages. first 1 login page , second page details (userinput.php) , while submitting update details in database , redirect page (thankyou.php).
now requirement is
if directly open (userinput.php) page should not. instead should redirect login page.
after given user details(userinput.php), go (thankyou.php) page. there chance of updating database same info going (userinput.php) page clicking button in browser.
how can overcome problem.
thank in advance.
- you must use session this: , check session variable that:
<?php session_start(); if(empty($_session['variable'])) { header("location:login.php"); die(); }
Comments
Post a Comment