Jump to content

[SOLVED] Disallow access to images until test passed


levi2613

Recommended Posts

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-

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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.