Solved

php password code

Posted on 2006-11-01
4
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Insert parts by customer 12 61
Hive vs Impla in Hadoop 1 144
Why use this lambda? 12 95
Notepad++ Question 11 25
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.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

739 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