Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP validation for html form

Status
Not open for further replies.

ChrissyB

Technical User
Dec 12, 2014
4
US
I have a html_form_send.php script that couples with my html form code.

I am mostly clueless when it comes to forms and php; I wonder if I can get some information on where to copy and paste this code in my website to make it work?

Do I copy and paste the html and php both in the <head></head>?

Or, do I post in the <body></body>?
Do I paste the php form into notepad as a stand alone script and upload it to my server?

From what I understand forms don't need <body>. I want to put this form on my contact page with a large image to the left and was confused on where to ultimately copy and paste the above information without disrupting both my layout and hoping the form works.

Also I've read online that php can be hacked easily. Is there a script that I can add to my php script to prevent this?
An encryption of sorts perhaps?

Any information would be most appreciated.
ChrissyB
Thanks so much.
 
o I copy and paste the html and php both in the <head></head>?

Or, do I post in the <body></body>?
Do I paste the php form into notepad as a stand alone script and upload it to my server?
All of the above

From what I understand forms don't need <body>.
Incorrect. the PHP to send the data doesn't but the <form> does



Also I've read online that php can be hacked easily
It can't, it is the way the PHP handles the form data that can be abused.

Is there a script that I can add to my php script to prevent this?
CAPTCHA and sanitising data (Google is your friend here)

An encryption of sorts perhaps?
Uneccessary unless you are collecting financial or sensitive and personally identifiable information.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Thanks so much for your assistance Chris. I plan to put together my form page today. It's nice to know that I have a professional such as yourself to get the very best of advise.

Chrissy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top