Jump to content

Captcha from External Server


.Darkman

Recommended Posts

Hello everybody,

 

Is it somehow possible to insert a captcha field into a form, such that i want the captcha's php file to on another server. The form's processing php file is also another servers.

 

For eg,

i have a contact form on http://clevertutorials.com which is processed on http://templora.com

 

But how do i add a captcha image or even math captcha to the form ?

 

Any help ?

 

Let me know if i am not clear.

 

 

Thanks,

Link to comment
Share on other sites

<?php echo "<img src=\"get_captcha_code.php?session_id=".session_id()."\" width=\"210\" height=\"37\" border=\"1\">"?>

 

in get_captcha_code.php the code can be like this

 

<?php

require('library/php-captcha.inc.php');
	$fonts_path = $g_RootPath."resources/fonts/";
$aFonts = array($fonts_path.'VeraBd.ttf', $fonts_path.'VeraIt.ttf', $fonts_path.'Vera.ttf');

$oPhpCaptcha = new PhpCaptchaColour($aFonts, 210, 40,$session_id);	
$oPhpCaptcha->Create();			

imagepng($oPhpCaptcha->oImage,'tmp.png');

header("Content-Type:image/png");
echo file_get_contents('tmp.png'); 

unlink('tmp.png');	

?>

Link to comment
Share on other sites

I am not much experienced in PHP. So i don't understand this code well.

 

Will it work if i use the <img> tag on one website and have the get_captcha_code.php on another ?

 

Yes it will work.

 

The path may be like this  <img src=\"www.anysite.com/captcha/get_captcha_code.php\"" .....

Link to comment
Share on other sites

How do i process it ?

 

Can you explain to in a bit detail ?

 

I have the form as :

 

<form method="post" action="http://externalsite.com/process.php">

<input name="sender_name" type="text" style="width: 250px;" />

<img src="http://externalsite.com/get_captcha_code.php" />

<input name="send" type="submit" id="send" value="Send" style="font-size: 18px; width: 100px; letter-spacing: 5px;" />

</form>

 

Now, what else should i do ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.