# Inserting CAPTCHA into existing form....

**URL:** <https://www.phphelp.com/t/inserting-captcha-into-existing-form/11830>\
**Category:** Security and PHP\
**Created:** [September 9, 2010, 1:40pm UTC](https://www.phphelp.com/t/inserting-captcha-into-existing-form/11830 "2010-09-09T13:40:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruce1969](https://www.phphelp.com/letter_avatar_proxy/v4/letter/b/977dab/32.png) [@Bruce1969](https://www.phphelp.com/u/Bruce1969)\
**Post date:** [September 9, 2010, 1:40pm UTC](https://www.phphelp.com/t/inserting-captcha-into-existing-form/11830/1 "2010-09-09T13:40:39Z")

</div>

I have an existing form (see link below) and would like to implement a CAPTCHA, but I don’t want to reconfigure my scripts - I just want to be able to have my SUBMIT verify the code (as I have existing alerts if a user doesn’t complete all fields):

[http://www.prescriptionpc.com/#section=contact](http://www.prescriptionpc.com/#section=contact)

The FORM code this is using is the following:

The above form "calls" a separate php file to validate and process the form.

So…  
if anyone knows a way or method of incorporating just the CAPTCHA code for validation within this exisitng form, please let me know.

Any and all help is greatly appreciated!  
-Bruce

---

<div class="post-metadata">

**Author:** ![Bruce1969](https://www.phphelp.com/letter_avatar_proxy/v4/letter/b/977dab/32.png) [@Bruce1969](https://www.phphelp.com/u/Bruce1969)\
**Post date:** [September 17, 2010, 6:18pm UTC](https://www.phphelp.com/t/inserting-captcha-into-existing-form/11830/2 "2010-09-17T18:18:19Z")

</div>

I figured it out…

# All I did was insert my CAPTCHA “alert” code (see below) into my existing validation form:

# if(isset($\_POST[“captcha”])) if($\_SESSION[“captcha”]==$\_POST[“captcha”]) { //CAPTHCA is valid; proceed the message: save to database, send by e-mail … echo ‘Security Code Incorrect!’; }

Then all I did was add method=“post” to my
