Solved

php password code

Posted on 2006-11-01
4
167 Views
Last Modified: 2010-05-18
Hi

I have a form in php and have a field which is an access code.

I only want the form to send email if say the code BFHTUJM65
is exact in the access code field if not error displayed in the field.

THanks
0
Comment
Question by:buster808
4 Comments
 
LVL 2

Expert Comment

by:eheimer
ID: 17866891
If I understand correctly, you want a form that will allow the user to enter an email address, subject, message, and authorization code.  When the form is submitted the email will only be sent if the authorization code is correct, otherwise an error will be displayed.  Is that correct?  Maybe you can post the form that you have.
0
 
LVL 3

Accepted Solution

by:
royce2020 earned 500 total points
ID: 17877925
well, if you're not too fussed about security, you could just have something like "if $passCode ==  'BFHTUJM65' sendEmail()" in your PHP code. No one without access to your PHP files will be able to see it (it won't show in the generated HTML code if a user veiws the source), but somone with a packet sniffer/catcher could intercept it and use it (it's being sent to the PHP server in plain text inside the POST request after all) but this is a bit beond a standard user.

I myself would use one way encription. Encript your pass code in a tempory PHP file with the code:
echo crypt('BFHTUJM65', '$2a$07$rasmuslerd...........$')
This will printout the encripted pass code sometghing like :  
 $2a$07$rasmuslerd............nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra
next, in your actual web code put the line:
if crypt(passcode, '$2a$07$rasmuslerd...........$') == "$2a$07$rasmuslerd............nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra" sendEmail()

Hope that's answered your question
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Exchange and Third Party application. 8 60
withoutTen challenge 14 88
strDist challenge 35 84
Hide vba in gp 7 48
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now