Solved

How do I use reCAPTCHA in this web page?

Posted on 2008-06-09
1
498 Views
Last Modified: 2012-05-05
I want to add reCAPTCHA to the attached web page. What do I need to modify of the code located at http://recaptcha.net/plugins/php/

Also, where should I insert it in HTML?
<html>

        <head>

                <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">

                <meta name="generator" content="GoLive CyberStudio"><title>Welcome to [CLIENT DOMAIN].com...On becoming and being a good parent</title><meta name="keyword" content="adolescence, adoption, advice, attention deficit hyper activity disorder, behavior techniques, blended family, child, child behavior, child psychologist, child psychology, childhood anxiety, childhood depression, coaching, coping skills,  drop-out, emotional development, homework, identity development, licensed psychologist,  parenthood, parenting, parenting strategies, parenting tips, parents, school failure, single parents, strategies, teenagers, workshops and seminars">

                <meta name="description" content="On becoming and being a good parent. To be a parent is not only to be the mother or father of your child or children; a parent must also be a student of society and continuously evaluate society's impact on the family. [CLIENT DOMAIN] can help you in your quest to become a better parent.">

<meta name="robots" content="all">

<meta name="revisit-after" content="30 days">

<link rel="stylesheet" href="ps.css" type="text/css">

                <script language="JavaScript"><!-- Hide from old browsers

function preloadImages()

                        {

                        preloadOffImages('../pix/pixel.gif','../pix/b1.jpg', '../pix/b2.jpg','../pix/b3.jpg','../pix/b4.jpg','../pix/b5.jpg','../pix/b60.jpg');                  

                        preloadOnImages('../pix/pixel.gif','../pix/b10.jpg', '../pix/b20.jpg','../pix/b30.jpg','../pix/b40.jpg','../pix/b50.jpg','../pix/b60.jpg'); 

                        }

                        

                function preloadOffImages() 

                        {

                                if (document.images) 

                                {

                        if (typeof(document.off) == 'undefined'){ document.off = new Object();}

                                }

                        document.off.images = new Array();                              var argLength = preloadOffImages.arguments.length;

    

                                for(arg=0;arg < argLength;arg++) 

                                {

                                document.off.images[arg] = new Image();

                                document.off.images[arg].src = preloadOffImages.arguments[arg];

                                } 

                                        }               function preloadOnImages() 

                        {

                        if (document.images) 

                                {

                        if (typeof(document.on) == 'undefined'){ document.on = new Object();}

                                }

                                document.on.images = new Array();                                       var argLength = preloadOnImages.arguments.length;

    

                                for(arg=0;arg < argLength;arg++) 

                                {

                                document.on.images[arg] = new Image();

                                document.on.images[arg].src = preloadOnImages.arguments[arg];

                                } 

                                        }

                                        

                                        

                                        function rollout(n)

                                        {

                                        if(n==1)        { document.B1.src=document.off.images[1].src;}

                                        if(n==2)        { document.B2.src=document.off.images[2].src;}

                                        if(n==3)        { document.B3.src=document.off.images[3].src;}

                                        if(n==4)        { document.B4.src=document.off.images[4].src;}

                                        if(n==5)        { document.B5.src=document.off.images[5].src;}

                                        if(n==6)        { document.B6.src=document.off.images[6].src;}

                                        if(n==7)        { document.B7.src=document.off.images[7].src;}

                                        if(n==8)        { document.B8.src=document.off.images[8].src;}

                                        }

                                        function rollover(n)

                                        {

                                        if(n==1)        { document.B1.src=document.on.images[1].src;}

                                        if(n==2)        { document.B2.src=document.on.images[2].src;}

                                        if(n==3)        { document.B3.src=document.on.images[3].src;}

                                        if(n==4)        { document.B4.src=document.on.images[4].src;}

                                        if(n==5)        { document.B5.src=document.on.images[5].src;}

                                        if(n==6)        { document.B6.src=document.on.images[6].src;}

                                        if(n==7)        { document.B7.src=document.on.images[7].src;}

                                        if(n==8)        { document.b8.src=document.on.images[8].src;}

                                        }

// Stop hiding from old browsers -->

</script>

        

        </head>

        <body bgcolor="#ffffff" link="#336699" alink="#003366" vlink="#336666">

                <center>

                        <p><table border="0" cellpadding="0" cellspacing="0" width="630" height="100%">                         <tr>

                                        <td align="middle" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="210">                                          <tr>

                                                        <td><img height="40" src="../pix/ps-banner-top.jpg" width="630" align="top" border="0"></td>

                                                </tr>

                                        </table>

                                        <img height="75" src="/banners/left_border.gif" width="5" align="top" border="0"><img height="75" src="/banners/BAREFOOTDR.jpg" width="611" align="top" border="0"><img height="75" src="/banners/right_border.gif" width="14" align="top" border="0"><table border="0" cellpadding="0" cellspacing="0" width="629" height="367">                                               <tr height="51">

                                                        <td width="115" align="middle" valign="top" height="51" background="../pix/menu-bk.jpg"><img height="51" src="../pix/nav-left.jpg" width="115" align="top"></td>

                                                        <td width="315" valign="top" align="middle" height="51"><img height="51" src="../pix/nav-bar.jpg" width="315" align="top"></td>

                                                        <td align="left" valign="top" height="51" colspan="3"><font color="#ffffff"><img height="51" src="../pix/nav-right.jpg" width="200" align="top"></font></td>

                                                </tr>                                           <tr>

                                                        <td width="115" align="left" valign="top" background="../pix/menu-bk.jpg"><a onmouseover="rollover(1);" onmouseout="rollout(1);" href="welcome.shtml"><img height="30" src="../pix/b1.jpg" width="115" align="top" border="0" name="B1"></a><a onmouseover="rollover(2);" onmouseout="rollout(2);" href="newsletter.shtml"><img height="30" src="../pix/b2.jpg" width="115" align="top" border="0" name="B2"></a><a onmouseover="rollover(3);" onmouseout="rollout(3);" href="library.shtml"><img height="30" src="../pix/b3.jpg" width="115" align="top" border="0" name="B3"></a><a onmouseover="rollover(4);" onmouseout="rollout(4);" href="updates.shtml"><img height="30" src="../pix/b4.jpg" width="115" align="top" border="0" name="B4"></a><a onmouseover="rollover(5);" onmouseout="rollout(5);" href="bio.shtml"><img height="30" src="../pix/b5.jpg" width="115" align="top" border="0" name="B5"></a><a onmouseover="rollover(6);" onmouseout="rollout(6);" href="contact.shtml"><img height="30" src="../pix/b60.jpg" width="115" align="top" border="0" name="B6"></a></td>

                                                        <td width="315" align="left" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="304">                                                                <tr>

                                                                        <td width="304">

                                                                        <center><table border="0" cellpadding="2" cellspacing="0" width="300" height="316">                                                                                     <tr>

                                                                                                <td align="left" valign="top" width="315">

                                                                                                <p><font size="2">I am interested in your comments, questions, and ideas. <br>

Please 

                        email me at: <img style="Z-INDEX: 100; POSITION: absolute" height="15" alt="" src="http://www.[CLIENT XYZ]/pix/smalleremailgraphicv2.jpg" width="143" border="0">                                                 Become part of [CLIENT DATA]!</font>

<p><b><font size="2">Free quarterly email newsletter:</font></b><font size="2"><br>

You can also use the form below to start receiving my <b>free</b> quarterly email newsletter. The WINTER 2008[CLIENT DOMAIN] Newsletter is titled <b>THOUGHTS ON DEATH AND DYING, PARENTS AND CHILDREN</b>.  Please provide me with your email address and indicate in the comment area

that you'd like to receive my newsletter or any previous newsletter you would be interested in reading. I would also appreciate finding out how you heard about [CLIENT XYZ]. That's all there is to it! Thanks for visiting [CLIENT XYZ].</font><br></p>

<p><b><img style="Z-INDEX: 100; POSITION: absolute" height="18" alt="" src="http://www.[CLIENT XYZ]/pix/largeremailgraphic.jpg" width="209" border="0"><br> </b></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

</td>

                                                                                        </tr>                                                                                   <tr>

                                                                                                <td width="315"><form name="MAILMAN" action="http://www.[CLIENT XYZ]/cgi-bin/ps/smail.cgi" method="post">

                                                                                                <input type="hidden" name="to" size="21" value="ragpsyd@aol.com"></td>

                                                                                        </tr>                                                                                   <tr>

                                                                                                <td bgcolor="#006699" width="315"><b><font color="#ffffff">Your E-Mail Address:</font></b></td>

                                                                                        </tr>                                                                                   <tr>

                                                                                                <td width="315"><input name="from" size="25"></td>

                                                                                        </tr>                                                                                   <tr>

                                                                                                <td bgcolor="#006699" width="315"><b><font color="#ffffff">Subject of E-Mail:</font></b></td>

                                                                                        </tr>                                                                                   <tr>

                                                                                                <td width="315"><input name="subject" size="31"></td>

                                                                                        </tr>                                                                                   <tr>

                                                                                                <td bgcolor="#006699" width="315"><b><font color="#ffffff">Comments:</font></b></td>

                                                                                        </tr>                                                                                   <tr>

                                                                                                <td width="315"><textarea name="contents" rows="10" cols="35" value=""></textarea></td>

                                                                                        </tr>                                                                                   <tr>

                                                                                                <td align="middle" width="315"><b><i><font color="#000000">THANK YOU </font></i><font color="#000000"><br>

                                                                                                </font></b><font color="#000000">[PRIVATE CLIENT INFO] A. [PRIVATE CLIENT INFO], Psy.D.</font></td>

                                                                                        </tr>                                                                                   <tr>

                                                                                                <td align="middle" width="315"><input type="reset" value="Clear form"><input type="submit" value="Send e-mail"></td>

                                                                                        </tr>

                                                                                </table>

                                                                        

                                                                        </center></td>

                                                                </tr>

                                                                

                                                                                        <tr>

                                                                                                <td align="left" valign="top" width="315">

                                                                                                <p></p>

</td>

                                                                                        </tr>                                                   </table>

                                                        </td>

                                                        <td width="12" align="middle" valign="top" background="../pix/left-bk.jpg"><img height="10" src="../pix/pixel.gif" width="12" align="top"></td>

                                                        <td bgcolor="#217594" align="left" valign="top" width="178"><img height="3" src="../pix/pixel.gif" width="178" align="top"><wbr><p><b><center><font size="3"><table border="5" bordercolor="#f5f5f5">

              

              <tr><th bgcolor="#ffe4e1"><big>TEN</big><br>BUILDING BLOCKS<br>

TO HELP CREATE<br>

SELF-CONFIDENCE<br>

IN CHILDREN<br>

<img height="150" src="/kidpix/202_thumb.jpg" width="120">

<br>

</th></tr></table></font></center>

<p><b><font size="2"><ol><li> BE AVAILABLE

<li>GIVE GENUINE PRAISE

<li>BE A ROLE MODEL

<li>TEACH RESPONSIBILITY

<li>TREAT IDEAS AND EMOTIONS SERIOUSLY

<li>HAVE CLEAR LIMITS AND EXPECTATIONS

<li>OPENLY DISCUSS VALUES AND ALLOW FOR DIFFERENCES

<li>TEACH TOLERANCE

<li>CREATE TIMES TO BE WITH ONE ANOTHER

<li>CHALLENGE THEIR STRENGTHS AND TEACH 

              ACCEPTANCE OF THEIR FAILURES(WORK AT IT!!!)</li>          </ol>

<p><font size="4"><i><b>LISTEN TO THEIR WORDS AND LISTEN TO THEIR HEARTS. </p></b></i></font></font></b></b>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

                                                        </td>

                                                        <td width="10" align="middle" valign="top" background="../pix/right-bk.jpg"><img height="10" src="../pix/pixel.gif" width="10" align="top"></td>

                                                </tr>                                           <tr>

                                                        <td width="115" align="left" valign="top"><img height="40" src="../pix/left-bottom.jpg" width="110" align="top"></td>

                                                        <td width="315"></td>

                                                        <td align="middle" valign="top" colspan="3">

                                                        <p><img height="40" src="../pix/bot-right.jpg" width="200" align="top"> 

                                                        <p><p><font size="1">Copyright 2002 © [CLIENT XYZ]<br>All rights reserved worldwide<br><a href="http://www.[DESIGN XYZ]/webdesigns/">[DESIGN XYZ]/  webdesigns</a></font></p>

                                                         </td>

                                                </tr>

                                        </table>

                                        </td>

                                </tr>

                        </table>

                

                </center>

                <p>

                <script language="JavaScript"><!-- Hide from old browsers

preloadImages();

// Stop hiding from old browsers -->

</script>

 </form></p>

        </body>

</html>

Open in new window

0
Comment
Question by:nicholasjwolf
1 Comment
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 21749521
1. make the page an php page and get the keys needed from recaptcha
2. insert the php calls in the top:

<?php

require_once('recaptchalib.php');
$publickey = "...";
$privatekey = "...";

# the response from reCAPTCHA
$resp = null;
# the error code from reCAPTCHA, if any
$error = null;
?>

<form .......

3. change
<input type="submit" value="Send e-mail">
to

<?

# are we submitting the page?
if ($_POST["submit"]) {
  $resp = recaptcha_check_answer ($privatekey,
                                  $_SERVER["REMOTE_ADDR"],
                                  $_POST["recaptcha_challenge_field"],
                                  $_POST["recaptcha_response_field"]);

  if ($resp->is_valid) {


#     Here you can copy the code from http://www.[CLIENT XYZ]/cgi-bin/ps/smail.cgi


  } else {
    # set the error code so that we can display it. You could also use
    # die ("reCAPTCHA failed"), but using the error message is
    # more user friendly
    $error = $resp->error;
    echo "<div style=\"color:red\">". $errror."</div>";
  }
}

echo recaptcha_get_html($publickey, $error);
?>
    <input type="submit" value="Send e-mail">

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

762 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

23 Experts available now in Live!

Get 1:1 Help Now