Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-18-2009, 02:19 AM   PM User | #1
wilcosky
New Coder

 
Join Date: Mar 2008
Posts: 34
Thanks: 7
Thanked 0 Times in 0 Posts
wilcosky has a little shameless behaviour in the past
Install reCaptcha using PHP on a .tpl page

I have a site that uses .tpl files. I would like to add the reCaptcha system to a form on one of the pages using php. From what I hear you can't just put php script into a .tpl file. I read that you can call php using tags like {}?

Can I add something to my .htaccess file that will allow php code to run from the .tpl file? I'm thinking that won't work, because the page does have a .php extension, but it's just calling the .tpl files.

Maybe this would be easier for me... Does anyone know of any captcha systems that I can install using all html and no php?
wilcosky is offline   Reply With Quote
Old 07-18-2009, 03:49 AM   PM User | #2
wilcosky
New Coder

 
Join Date: Mar 2008
Posts: 34
Thanks: 7
Thanked 0 Times in 0 Posts
wilcosky has a little shameless behaviour in the past
nevermind. i figured it out. i guess this thread can just be removed.
wilcosky is offline   Reply With Quote
Old 07-18-2009, 07:45 AM   PM User | #3
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
What was your solution?
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 07-18-2009, 01:54 PM   PM User | #4
mioot
New Coder

 
Join Date: Jun 2009
Posts: 35
Thanks: 0
Thanked 2 Times in 2 Posts
mioot is an unknown quantity at this point
These .tpl file is smarty template file. u want to create new tpl file means read that smartytemplates. U got an idea
__________________
Live chat software - chat with your web site visitors in real time.
Internet web directory - list of top100 sites in diffrent category
mioot is offline   Reply With Quote
Old 09-12-2009, 07:28 PM   PM User | #5
wilcosky
New Coder

 
Join Date: Mar 2008
Posts: 34
Thanks: 7
Thanked 0 Times in 0 Posts
wilcosky has a little shameless behaviour in the past
Quote:
Originally Posted by _Aerospace_Eng_ View Post
What was your solution?
Sorry, my solution was to use a jquery ajax script along with some php. But, I couldn't use php in the .tpl file, so to show the reCAPTCHA I used the ajax and to validate the reCAPTCHA I used a separate .php file. Now, if a spammer turns javascript off, the reCAPTCHA won't show unfortunately BUT, they also won't be able to submit the form because the separate php file looks for the reCAPTCHA and if it's incorrect or if it doesn't detect a reCAPTCHA code, then the form won't submit. So it's still secure even though javascript is evolved.

I found the step by step instructions here:

http://www.darksideofthecarton.com/2...omment-page-1/
wilcosky is offline   Reply With Quote
Old 09-13-2009, 12:02 AM   PM User | #6
Zangeel
Regular Coder

 
Zangeel's Avatar
 
Join Date: Oct 2007
Location: public_html/
Posts: 638
Thanks: 17
Thanked 79 Times in 79 Posts
Zangeel will become famous soon enough
If the smarty configuration allows it you can use
Code:
{php}
//Normal PHP worjs here
{/php}
__________________
PHP Code:
$aString is_string((string)array()) ? true false// true :D 
[/CENTER]
Zangeel is offline   Reply With Quote
Users who have thanked Zangeel for this post:
wilcosky (09-18-2009)
Old 09-18-2009, 04:19 AM   PM User | #7
wilcosky
New Coder

 
Join Date: Mar 2008
Posts: 34
Thanks: 7
Thanked 0 Times in 0 Posts
wilcosky has a little shameless behaviour in the past
Quote:
Originally Posted by Zangeel View Post
If the smarty configuration allows it you can use
Code:
{php}
//Normal PHP worjs here
{/php}

Thanks for the suggestion, I'll try that in the future. Honestly, I'm not going to try it for this since I got it working using another method.

Also, to correct myself above, the recaptcha will show if javascript is on or off. If javascript is on, it shows the recaptcha using recaptcha.net's javascript code. If javascript is turned off, then the recaptcha shows through an iframe.

So, that's how I was able to show the recaptcha without using PHP. To validate the recaptcha, I still used PHP.
wilcosky is offline   Reply With Quote
Reply

Bookmarks

Tags
captcha, php, recaptcha, tpl

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:47 AM.


Advertisement
Log in to turn off these ads.