levi2613 Posted February 6, 2009 Share Posted February 6, 2009 I'm coding a test page that asks the user to identify a trait in an image. After they submit their guess, another image with the correct answer highlighted appears. My issue is that anyone can just type in www.domain.com/test/solution.jpg and the correct answer image will show. This is an .htaccess protected site, but I didn't know how to deny access to a folder temporarily.... Any ideas? Thanks so much -- you guys rock. -levi- Link to comment https://forums.phpfreaks.com/topic/144142-solved-disallow-access-to-images-until-test-passed/ Share on other sites More sharing options...
Lodius2000 Posted February 6, 2009 Share Posted February 6, 2009 solution: make a page for the test, and a page for the solution... test.php: if the answer is correct set a session variable $_SESSION['passed'] = 1; solution.php: if ($_SESSION['passed'] = 1;){ display image } else { redirect back to test.php } though you stated this is an htaccess website, you posted in a php forum, so there is a php answer Link to comment https://forums.phpfreaks.com/topic/144142-solved-disallow-access-to-images-until-test-passed/#findComment-756377 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.