.Darkman Posted May 11, 2007 Share Posted May 11, 2007 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, Quote Link to comment https://forums.phpfreaks.com/topic/50915-captcha-from-external-server/ Share on other sites More sharing options...
jitesh Posted May 11, 2007 Share Posted May 11, 2007 <?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'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/50915-captcha-from-external-server/#findComment-250420 Share on other sites More sharing options...
.Darkman Posted May 11, 2007 Author Share Posted May 11, 2007 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 ? Quote Link to comment https://forums.phpfreaks.com/topic/50915-captcha-from-external-server/#findComment-250426 Share on other sites More sharing options...
jitesh Posted May 11, 2007 Share Posted May 11, 2007 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\"" ..... Quote Link to comment https://forums.phpfreaks.com/topic/50915-captcha-from-external-server/#findComment-250427 Share on other sites More sharing options...
.Darkman Posted May 11, 2007 Author Share Posted May 11, 2007 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 ? Quote Link to comment https://forums.phpfreaks.com/topic/50915-captcha-from-external-server/#findComment-250431 Share on other sites More sharing options...
jitesh Posted May 11, 2007 Share Posted May 11, 2007 Run this in browser "http://externalsite.com/get_captcha_code.php" Are you getting anything ? I got "page can not be found". Quote Link to comment https://forums.phpfreaks.com/topic/50915-captcha-from-external-server/#findComment-250433 Share on other sites More sharing options...
.Darkman Posted May 11, 2007 Author Share Posted May 11, 2007 No, externalsite.com was just an exmaple. Quote Link to comment https://forums.phpfreaks.com/topic/50915-captcha-from-external-server/#findComment-250452 Share on other sites More sharing options...
jitesh Posted May 11, 2007 Share Posted May 11, 2007 review the integration details of third party or post it here. Quote Link to comment https://forums.phpfreaks.com/topic/50915-captcha-from-external-server/#findComment-250453 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.