Php Question?

by 9 replies
10
In my quest to learn Php I have another task but I've hit a block.

What I am trying to do is have a resume put online BUT when someone clicks on this html button to go to my resume page they are given a password prompt. What I want is that if they enter the correct password the resume page displays and if not then an error message appears. I am trying to do this with Php. The thing I can't get around or at the moment can't think of is how can I prevent the user from just typing in the url of the resume page and thus going around my password check? I thought about having the resume as an "include" to another file but if the user does a "view source" they can still see the resume file name. Any suggestions? Maybe I'm approaching this wrong or missing the obvious?
#programming #php #question
  • Personally it seems to me that you're trying to annoy all your prospective employers, but there are a few ways you can do that. You can use cookies or REFERER to find out where he came from.
  • For something like this, you'd probably want to keep it as simple as possible.

    You can do it with the code I've just thrown together and attached.

    Provided the resume has a hard to guess file name then include(""); is perfectly fine. The file name will not be shown in the HTML source.
    • [2] replies
    • Great code snippet!

      I'd probably change the password check part to make it easier to read, but from the way the code looks, I imagine that the code should work fine.


    • Maybe not in the HTML source.. but this will not prevent someone from just emailing or otherwise communicating the link to everyone
      • [1] reply
  • Hi,
    You just use one database for storing passwords then retrieve the password from database and then check this will do

Next Topics on Trending Feed

  • 10

    In my quest to learn Php I have another task but I've hit a block. What I am trying to do is have a resume put online BUT when someone clicks on this html button to go to my resume page they are given a password prompt. What I want is that if they enter the correct password the resume page displays and if not then an error message appears. I am trying to do this with Php. The thing I can't get around or at the moment can't think of is how can I prevent the user from just typing in the url of the resume page and thus going around my password check? I thought about having the resume as an "include" to another file but if the user does a "view source" they can still see the resume file name. Any suggestions? Maybe I'm approaching this wrong or missing the obvious?