/    Sign up×
Community /Pin to ProfileBookmark

Code protecting a web page?

Hello everybody,

I have a web page on my website which I would like to protect with Codes or Passwords. So when page is opened it shows a box for entering a code. I looked over google and found nothing.

Even better solution would be randomly generated codes (only one of them would be used) which would be sent to clients to access protected page.

The thing is that I’m into SMS business, and I would like the clients when they send SMS they receive CODE for protected page and they can enter it.

I’ve seen on some websites that you send SMS at some number, then you receive this randomly generated code, which you enter to get some benefits. This would be best. An important notice is that I can edit the content of SMS (which is sent to clients) in PHP however I want.

I hope you understand what do I want, and I hope you can help me out.

Thanks in advance..?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@StelarMay 16.2010 — I think that you should first randomize X(as much as you want) characters(from 33 to 126, all printable characters) and store the result in a file, whilst also sending an SMS like "Your code is ".$result.

Then when you enter the page you would enter the code you have, and send it through AJAX to another page which would then see if the code is inside the file, and if yes it deletes it and echoes "TRUE". Otherwise it echoes "FALSE".

And like this you can get the benefits

Also you don't necessarily need Ajax, you could have for example Page 1 which asks for the SMS code, and if the user presses "I don't have" it sends the other page through $_GET['reg'] a false, otherwise it does the previous process and does as i said

Hope this helped
Copy linkTweet thisAlerts:
@purefanMay 17.2010 — you may want to look at .htaccess protection
×

Success!

Help @dzahdooo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...