i have created a application ...when i give the URL of the second page the page is getting displayed...but i want all the user to enter the application only from the first page where it check whether the user is valid.... what should i do to make my application more secure

Recommended Answers

All 4 Replies

Add sessions. If the user enters his username and password in the first page, add his username to the session(if he is a valid user). Then just add a condition,

if(! isset($_SESSION['username'])){ echo " You have to go back to page 1 and enter your username..."; exit }

if session variable is blank using heder to function to redirect the page

hi,
it is displaying the print statement even if he is a valid user
if(! isset($_SESSION)){ echo " You have to go back to page 1 and enter your username..."; exit ;}

i have attached the forms in which i tried...........

:icon_rolleyes: In start1.php, you are adding name to the session. But in viewuser.php, you are checking for username !?!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.