Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Recaptcha in html

HTML recaptcha

  • Please log in to reply

#1
D3b

D3b

    New Member

  • Member
  • Pip
  • 9 posts
Hello Geeks!
This is my first post. I recently became the owner(caretaker) of some websites written in html....Which I have never coded with. I was successful in getting the recaptcha widget in the page and it appears to be working...the problem is that I seem to have lost all the other contents of the page...I'm thinking that maybe I put the widget code in the wrong spot or it's some other simple issue that I'm just not aware of.
I can send the code if there is anyone who would be able to help.
Thanks so much!
Debbie
  • 0

Advertisements


#2
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

Any chance you saved a backup copy of original page(s) to compare with? Is it truly coded in HTML or is using something like CMS (example: Wordpress)? Is/are site(s) viewable online? Not sure I'll be able to help you with any other coding other than HTML.


  • 0

#3
D3b

D3b

    New Member

  • Topic Starter
  • Member
  • Pip
  • 9 posts

Any chance you saved a backup copy of original page(s) to compare with? Is it truly coded in HTML or is using something like CMS (example: Wordpress)? Is/are site(s) viewable online? Not sure I'll be able to help you with any other coding other than HTML.

Hello and thanks for the reply.As far as I know it is straight hamlet. I am using Dreamweaver to edit it. I did save the original and working in a backup page. you can check the website: www.terasemjournals.org/subscribeThe copy I am working on with the recaptcha is below and the original is below that.I noted my edits with a: ""Please let me know if you have any further questions. I appreciate your help.Deb--------------------I added this php code---- The Terasem Journals Online | Subscribe-----I added this line below-----http://c26.statcount...294&invisible=0
Subscribe to the Terasem Journals

Sign up for a free subscription and receive the text of the Journals via email upon their publication.




Your Name:



Your Email Address:



Comments:


----added line below-----
Amazon.com Widgets --------------------------------end of copy-------------------ORIGINAL ---------------------------------------------------------------------- The Terasem Journals Online | Subscribehttp://c26.statcount...294&invisible=0
Subscribe to the Terasem Journals

Sign up for a free subscription and receive the text of the Journals via email upon their publication.




Your Name:



Your Email Address:



Comments:



Amazon.com Widgets
  • 0

#4
D3b

D3b

    New Member

  • Topic Starter
  • Member
  • Pip
  • 9 posts
....

Edited by D3b, 16 March 2016 - 07:17 PM.

  • 0

#5
D3b

D3b

    New Member

  • Topic Starter
  • Member
  • Pip
  • 9 posts
..

Edited by D3b, 16 March 2016 - 07:17 PM.

  • 0

#6
D3b

D3b

    New Member

  • Topic Starter
  • Member
  • Pip
  • 9 posts

trying again! this is the copy that I edited with the recaptcha. my edits are in red

 

////////////<?php
 if(isset($_POST['Subscribe'])){
  
  $url = 'https://www.google.c...pi/siteverify';
  $privatekey = "privatekey";
  
  $response = file_get_contents($url."?secret=".$privatekey."&response=".$_POST['g-recaptcha-response']."&remoteip=".$SERVER['REMOTE_ADDR']);
  $data =json_decode($response);

  }
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...ransitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Description" content="The Terasem Journals are the journals of the Terasem Movement, exploring geoethical nanotechnology and personal cyberconsciousness, with the goal of education. " />
  
<title>The Terasem Journals Online | Subscribe</title>

<link rel="stylesheet" type="text/css" href="journalpage.css"/>
<script src='https://www.google.c...i.js'></script>
</head>

<body>
<!-- Start of StatCounter Code -->
<script type="text/javascript" language="javascript">
var sc_project=2645030;
var sc_invisible=0;
var sc_partition=25;
var sc_security="9e4eb294";
</script>

<script type="text/javascript" language="javascript" src="http://www.statcount...pt><noscript><a href="http://www.statcounter.com/" target="_blank"><img  src="http://c26.statcount...294&invisible=0" alt="blog counter" border="0"></a> </noscript>
<!-- End of StatCounter Code -->

<!--Header-->
<script language="javascript" type="text/javascript" src="TJHeader-b.txt"></script>
<!--End Header-->

<!--Left Column--> 
<td width="205" height="323" valign="top">
<p align="left"><script language="javascript" type="text/javascript" src="Sidebar_left.txt"></script></p>

<!--Page Main Content-->      
     
   <td width="551" valign="top" height="499" style="padding-left:20px;padding-right:20px;padding-top:15px;padding-bottom:15px;">
        <h1 align="left">Subscribe to the Terasem Journals</h1>
               <p align="left" class="text">Sign up for a free subscription and receive the text of the Journals via email upon their publication.</p>
    
     
      <div align="left">
       <form action="http://www.gmavt.net...bin/formmail.pl" method="POST">
        <div align="left">
          <blockquote>
            <p>
              <input type="hidden" name="recipient" value="[email protected]">
              <input type="hidden" name="required" value="">
              <input type="hidden" name="redirect" value="http://www.terasemjournals.org">
              <input type="hidden" name="subject" value="Subscription Form">
             
            <p>&nbsp;</p>
          </blockquote>
          <table width="450" border="0" cellspacing="2" cellpadding="0">
            <tr>
              <td width="140">
                <div align="right">
                  <font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Your Name:</font></div>             </td>
             <td width="10"></td>
             <td width="250">
              <div align="right">
                  <input type="text" name="realname" size="38"></div>             </td>
           </tr>
            <tr height="10">
              <td width="140" height="10">
                <div align="right"></div>             </td>
             <td width="10" height="10"></td>
             <td width="250" height="10"></td>
           </tr>
            <tr>
              <td width="140">
                <div align="right">
                  <font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Your Email Address:</font></div>             </td>
             <td width="10"></td>
             <td width="250">
              <div align="right">
                  <input type="text" name="email" size="38"></div>             </td>
           </tr>
            <tr height="10">
              <td width="140" height="10">
                <div align="right"></div>             </td>
             <td width="10" height="10"></td>
             <td width="250" height="10"></td>
           </tr>
            <tr height="86">
              <td valign="top" width="140" height="86">
                <div align="right">
                  <font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Comments:</font></div>             </td>
             <td width="10" height="86"></td>
             <td width="250" height="86">
              <div align="right">
                  <textarea name="comments" rows="16" cols="29"></textarea></div>             </td>
           </tr>
            <tr height="10">
              <td width="140" height="10"></td>
             <td width="10" height="10"></td>
             <td width="250" height="10"></td>
           </tr>
            <tr>
              <td colspan="3">
                <center>
          <div class="g-recaptcha"data-sitekey="sitekey"></div>
                  <input type="submit" name="" value="Subscribe">
                  </center>
            <br>                </td>
           </tr>
            </table>
         </div>
       </form>
       </div>     </td>
     
    
<!--End Main page content-->
 
 <!--Right Column-->  
<td width="128" valign="top">       
<!-- Begin Amazon Ad -->
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.ma...ent/swflash.cab" id="Player_63784f73-d630-43c9-8166-f6909497e567"  WIDTH="160px" HEIGHT="600px"> <PARAM NAME="movie" VALUE="http://ws.amazon.com...emplate"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#FFFFFF"><PARAM NAME="allowscriptaccess" VALUE="always"><embed src="http://ws.amazon.com...DisplayTemplate" id="Player_63784f73-d630-43c9-8166-f6909497e567" quality="high" bgcolor="#ffffff" name="Player_63784f73-d630-43c9-8166-f6909497e567" allowscriptaccess="always"  type="application/x-shockwave-flash" align="middle" height="600px" width="160px"></embed></OBJECT> <NOSCRIPT><A HREF="http://ws.amazon.com...ipt">Amazon.com Widgets</A></NOSCRIPT>
 <!-- End Amazon Ad --></td>

<!--End Right Column-->     
     
    </tr>
 
<!--Footer--> 
<script language="javascript" type="text/javascript" src="FooterMain.txt"></script>
<!--End Footer-->

</table>
</div>

</body>
</html>


  • 0

#7
D3b

D3b

    New Member

  • Topic Starter
  • Member
  • Pip
  • 9 posts

here's the original code

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml">

 

 

<head>

 

 

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

 

<meta name="Description" content="The Terasem Journals are the journals of the Terasem Movement, exploring geoethical nanotechnology and personal cyberconsciousness, with the goal of education. " />

 

 

 

<title>The Terasem Journals Online | Subscribe</title>

 

 

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

 

 

</head>

 

 

<body>

 

<!-- Start of StatCounter Code -->

 

<script type="text/javascript" language="javascript">

 

var sc_project=2645030;

 

var sc_invisible=0;

 

var sc_partition=25;

 

var sc_security="9e4eb294";

 

</script>

 

 

<script type="text/javascript" language="javascript" src="http://www.statcount...pt><noscript><ahref="http://www.statcounter.com/" target="_blank"><img  src="http://c26.statcounter.com/counter.php?sc_project=2645030&java=0&security=9e4eb294&invisible=0" alt="blog counter" border="0"></a> </noscript>

 

<!-- End of StatCounter Code -->

 

 

<!--Header-->

 

<script language="javascript" type="text/javascript" src="TJHeader-b.txt"></script>

 

<!--End Header-->

 

 

 

<!--Left Column--> 

 

<td width="205" height="323" valign="top">

 

<p align="left"><script language="javascript" type="text/javascript" src="Sidebar_left.txt"></script></p>

 

 

<!--Page Main Content-->      

 

     

 

   <td width="551" valign="top" height="499" style="padding-left:20px;padding-right:20px;padding-top:15px;padding-bottom:15px;">

 

        <h1 align="left">Subscribe to the Terasem Journals</h1>

 

               <p align="left" class="text">Sign up for a free subscription and receive the text of the Journals via email upon their publication.</p>

 

   

 

    

 

      <div align="left">

 

       <form action="http://www.gmavt.net...in/formmail.pl"method="POST">

 

        <div align="left">

 

          <blockquote>

 

            <p>

 

              <input type="hidden" name="recipient" value="[email protected]">

 

              <input type="hidden" name="required" value="">

 

              <input type="hidden" name="redirect" value="http://www.terasemjournals.org">

 

              <input type="hidden" name="subject" value="Subscription Form">

 

             

 

            <p>&nbsp;</p>

 

          </blockquote>

 

          <table width="450" border="0" cellspacing="2" cellpadding="0">

 

            <tr>

 

              <td width="140">

 

                <div align="right">

 

                  <font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Your Name:</font></div>             </td>

 

             <td width="10"></td>

 

             <td width="250">

 

              <div align="right">

 

                  <input type="text" name="realname" size="38"></div>             </td>

 

           </tr>

 

            <tr height="10">

 

              <td width="140" height="10">

 

                <div align="right"></div>             </td>

 

             <td width="10" height="10"></td>

 

             <td width="250" height="10"></td>

 

           </tr>

 

            <tr>

 

              <td width="140">

 

                <div align="right">

 

                  <font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Your Email Address:</font></div>             </td>

 

             <td width="10"></td>

 

             <td width="250">

 

              <div align="right">

 

                  <input type="text" name="email" size="38"></div>             </td>

 

           </tr>

 

            <tr height="10">

 

              <td width="140" height="10">

 

                <div align="right"></div>             </td>

 

             <td width="10" height="10"></td>

 

             <td width="250" height="10"></td>

 

           </tr>

 

            <tr height="86">

 

              <td valign="top" width="140" height="86">

 

                <div align="right">

 

                  <font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Comments:</font></div>             </td>

 

             <td width="10" height="86"></td>

 

             <td width="250" height="86">

 

              <div align="right">

 

                  <textarea name="comments" rows="16" cols="29"></textarea></div>             </td>

 

           </tr>

 

            <tr height="10">

 

              <td width="140" height="10"></td>

 

             <td width="10" height="10"></td>

 

             <td width="250" height="10"></td>

 

           </tr>

 

            <tr>

 

              <td colspan="3">

 

                <center>

 

                  <input type="submit" name="" value="Subscribe">

 

                  </center>

 

            <br>                </td>

 

           </tr>

 

            </table>

 

         </div>

 

       </form>

 

       </div>     </td>

 

    

 

   

 

<!--End Main page content-->

 

 

<!--Right Column-->  

 

<td width="128" valign="top">       

 

<!-- Begin Amazon Ad -->

 

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.ma...nt/swflash.cab"id="Player_63784f73-d630-43c9-8166-f6909497e567"  WIDTH="160px" HEIGHT="600px"> <PARAM NAME="movie" VALUE="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fterasmoveminc-20%2F8010%2F63784f73-d630-43c9-8166-f6909497e567&Operation=GetDisplayTemplate"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#FFFFFF"><PARAM NAME="allowscriptaccess" VALUE="always"><embed src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fterasmoveminc-20%2F8010%2F63784f73-d630-43c9-8166-f6909497e567&Operation=GetDisplayTemplate" id="Player_63784f73-d630-43c9-8166-f6909497e567" quality="high" bgcolor="#ffffff" name="Player_63784f73-d630-43c9-8166-f6909497e567" allowscriptaccess="always"  type="application/x-shockwave-flash" align="middle" height="600px" width="160px"></embed></OBJECT> <NOSCRIPT><A HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Fterasmoveminc-20%2F8010%2F63784f73-d630-43c9-8166-f6909497e567&Operation=NoScript">Amazon.com Widgets</A></NOSCRIPT>

 

<!-- End Amazon Ad --></td>

 

 

<!--End Right Column-->     

 

     

 

    </tr>

 

 

 

<!--Footer-->

 

<script language="javascript" type="text/javascript" src="FooterMain.txt"></script>

 

<!--End Footer-->

 

 

</table>

 

</div>

 

 

</body>

 

</html>


  • 0

#8
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

Sorry for taking so long to get back to you. Had some photo editing to do.

 

When you say the contents of page do not show after insering the recaptcha widget, are you viewing the page in Dreamweaver's Preview (Live View?) mode with the default browser? If so, this may be part of the problem as the actual code page requires paths to many files that are still on the actual server. I don't know if you have set all paths to compensate for this when viewing the files locally in your browser.

 

Viewing the original code shows a mess of errors. Most are because the files use the XHTML 1.0 Transitional document type while the page is not coded to XHTML. Correcting the errors may or may not fix your problem, but it wouldn't hurt. Be better if it was recoded to HTML5. If you expect the site to be viewable on many devices, you need to recode using responsive web design.

 

I didn't check on the widget site where the recommended placement for the widget should be as I'm not clear as to which site you got the actual widget code.

 

I'm a little slow, so please bear with me.


  • 0

#9
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

To post any code, click on "More Reply Options" button. Should bring up the more advanced editor. Click on the Icon (looks like <>). Mousing over it will popup "Code". Be sure to paste all code as instructed by the Code popup window.

 

Or, you can attached the file if wanted.


  • 0

#10
D3b

D3b

    New Member

  • Topic Starter
  • Member
  • Pip
  • 9 posts

Sorry for taking so long to get back to you. Had some photo editing to do.
 
When you say the contents of page do not show after insering the recaptcha widget, are you viewing the page in Dreamweaver's Preview (Live View?) mode with the default browser? If so, this may be part of the problem as the actual code page requires paths to many files that are still on the actual server. I don't know if you have set all paths to compensate for this when viewing the files locally in your browser.
 
Viewing the original code shows a mess of errors. Most are because the files use the XHTML 1.0 Transitional document type while the page is not coded to XHTML. Correcting the errors may or may not fix your problem, but it wouldn't hurt. Be better if it was recoded to HTML5. If you expect the site to be viewable on many devices, you need to recode using responsive web design.
 
I didn't check on the widget site where the recommended placement for the widget should be as I'm not clear as to which site you got the actual widget code.
 
I'm a little slow, so please bear with me.


Hello and thanks for the reply!
When I view the page it is live on the server because in order to see if the captcha works it needs to be able to reach googles server.
I got the keys and code for the reCaptcha from Google. They tell you where to place the keys, but I needed to add that php code which I found somewhere else.
I'm really not sure what to do at this point. I realize the code needs to be updated but I'm not ready to delve into that yet. I did read about a honeypot fix for spam mail. Maybe that would be an easier option at this point? At least stop the spam for now while I get better aquatinted with the code.
Are you familiar with the honeypot fix?
Is there an 'easy' way to convert the code to html5?
Thank you
Debbie
  • 0

Advertisements


#11
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

I used honeypot many years ago. Would suggest completing all the fixes needed before setting up anything else. I'm going to re-edit your page to use full paths so I can view locally in browser. Hopefully, this will allow me to see why you say the page contents disappear when you add Captcha code.

 

Do you have a link to YOUR coded page online that has the problem you're having with contents not showing?

 

There is no easy way to covert an XHTML coded page to HTML5 ( Converting to HTML 5 ). Also, might help: Web Code Tools / Basic HTML Code Generator / Web Code Geeks 


  • 0

#12
D3b

D3b

    New Member

  • Topic Starter
  • Member
  • Pip
  • 9 posts

Thanks again for your reply

Yes, I have my page that has the recaptcha and the form online.

You can access it here: http://www.terasemjo...rg/subcap1.html

 

Another thing I was thinking about doing was just adding a simple math question to weed out the bots.

I realize I need to fix the page, but its not going to be quick since I'm a newbie and they are getting almost 50 emails a day.

So you can see why I need a quick fix while I feel my way around the rest of it.

Deb


  • 0

#13
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

Hi:

 

Took a look at http://www.terasemjo...rg/subcap1.html. Attaching a screenshot of what I saw in Firefox browser. I see some content missing when comparing http://www.terasemjo...rg/subcap1.html and http://www.terasemjo...scription.html. Some problems are paths that look like they refer back to your hardrive on your computer: ' src="../../Desktop/websitestuff/FooterMain.txt"' Will not work this way when viewing page online. Original page shows: 'src="FooterMain.txt"' This is the footer script. Lot of your paths on your page need to be changed back to the correct paths to reflect the server path for files.

 

I am not sure the php code should be above the document tag. Is this what Google says to do? Not sure you closed the PHP properly either. Think it should end with " ?>" (no quotes).

 

Those JavaScripts for the header and footer should be replaced with the actual text. People may have JS turned off. Also, creating errors on page.

 

Once missing content problem is solved, table tags should be changed to fit the document type. I think the problem right now looks to be incorrect paths for your online view of edited page.

Attached Thumbnails

  • TerasemSite_2016-03-20-21-09-37.png

Edited by AstraNut, 21 March 2016 - 01:08 AM.

  • 0

#14
D3b

D3b

    New Member

  • Topic Starter
  • Member
  • Pip
  • 9 posts

OK! Yes, I see where the links were changed. I think I did that when in the editor.

so, I changed the links and everything showed up again. Thank you!

Everything appears to be working EXCEPT that the recaptcha is not stopping the spam! It works when you go and verify...and it puts the check mark that it verified, but if you don't do the recaptcha verify it still sends the mail thru.

could that be the placement of the PHP code? I put the ?> at the end of the code, but that didn't fix. I'm assuming that the php code is what tells it to reject if verify is not performed? 

Google did not specify that code at all or where to place it. I found that while researching. Is it even the correct code?

Thank you for your patience with me. We are so close to getting this thing working!!


Edited by D3b, 21 March 2016 - 11:14 AM.

  • 0

#15
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts

I doubt that PHP code is doing anything if Google's Captcha did not have it. Will take a look at the Captcha code and instructions Google gave and get back to you. You might be able to use a better Captcha or a more simpler one as you suggested provided you want to insure it is humans and not bots subscribing. Spam email may have to be solved another way.

 

Attaching the HTML and CSS files I edited for you. You may not like the look, but most errors were removed except for the Amazon ad code which does not play nice with an XHTML 1.0 document file.  Some Captcha code hicups from Validator but no biggie. You should be able to view these files offline althought the Captcha will not work. Online viewing should be fine if you can place them on a test server or just change the name of the CSS file and reflect that change on the HTML file for the CSS link path.

Attached Files


Edited by AstraNut, 21 March 2016 - 09:04 PM.

  • 0






Similar Topics


Also tagged with one or more of these keywords: HTML, recaptcha

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP