Hello.

I am attempting to add a Google reCaptcha to my form. This form is located on an .html page, but I am reading documentation that states I should rename the page with a .php suffix.

I did this and reloaded the page and, obviously, nothing was displayed at all.

I am a bit confused. In using this I will be dealing with secret keys which will need to be hidden (They would be displayed openly in an .html document).

I just wondered if anyone had any experience with reCaptcha or any of the issues of renaming a page .php.

At this point I am very confused about the entire process of implementing this.

Thank you in advance!

Are using a web server in your setup?
You can't just rename an html file to have a php extension and have it work. PHP files are compiled by a web server (Apache, IIS, etc) and sent to the browser.
If you have an html ffile just lying around in a directory somewhere and rename to PHP nothing will happen, the page definitely won't present itself correctly in a browser.
If you haven't got an apache/WAMP set up running you'll need to look into that first. There try the CAPTHA thing again.

If you have further issues post up the code and have a look at the error logs from the server. They'll give you a hint as to what is going wrong.

hericles:

Thank you for your reply.

I am using this file on a web hosting service, yes, a live server - Although the site is not actually live yet or complete, it is available on the Web.

What I mean is, I changed the suffix for the file containing the form to .php (from .html). When I reloaded the page/form it was blank. I assumed this was because it is now a .php file and the page was now essentially hidden.

I made the changes on the company's server.

I do not have direct access to the root of the server to change anything.

I hope that I am making sense wth this...

Thanks,
Matthew

only the php elements will be hidden so you will have to look at the code for the page i would think

Might be time to post up the code for the page. Seeing a completely blank screen means you've got a fatal error in the PHP that causes it to basically crash.

Nice one. I have read the question and answers and really much benefited.

Post the code here so we can help you very fast.. With out the code it was easy to give you an solution. Google have two type of reCAPTHA, so we need to know are you using the old one or new one..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.