dwandswforlife Posted October 16, 2012 Share Posted October 16, 2012 (edited) Just so you all know where I am at with the game development; I have successfully configured it to my host and I am able to log in and play, but that is only because I am the admin. Unfortunately, the first issue I am having is that when attempting to register, such as a new member/guest, the captcha image is not loading. Here is the captcha page code in case it helps; <?php define('IN_EZRPG', true); require_once('init.php'); //$code_length = rand(5,6); $code_length = 4; $rand_start = mt_rand(0, 250); $font = 'static/fonts/Capture_it.ttf'; $fontSize = 30; $padding = 10; $l1 = strtoupper(createKey(1, 1)); $l2 = strtoupper(createKey(1, 1)); $l3 = strtoupper(createKey(1, 1)); $l4 = strtoupper(createKey(1, 1)); $verify_string = $l1 . ' ' . $l2 . ' ' . $l3 . ' ' . $l4; $real_string = $l1 . $l2 . $l3 . $l4; $verify_code = sha1(strtoupper($real_string) . SECRET_KEY); $_SESSION['verify_code'] = $verify_code; function makeRBGColor($color, $image) { $color = str_replace("#", "", $color); $red = hexdec(substr($color, 0, 2)); $green = hexdec(substr($color, 2, 2)); $blue = hexdec(substr($color, 4, 2)); $out = ImageColorAllocate($image, $red, $green, $blue); return $out; } $wordBox = imageftbbox($fontSize, 0, $font, $verify_string); $wordBoxWidth = $wordBox[2]; $wordBoxHeight = $wordBox[1] + abs($wordBox[7]); $containerWidth = $wordBoxWidth + ($padding * 2); $containerHeight = $wordBoxHeight + ($padding * 2); $textX = $padding; $textY = $containerHeight - $padding; $captchaImage = imagecreate($containerWidth, $containerHeight); $red = randColor(); $green = randColor(); $blue = randColor(); $backgroundColor = ImageColorAllocate($captchaImage, $red, $green, $blue); $rred = 255-$red; $rgreen = 255-$green; $rblue = 255-$blue; $textColor = ImageColorAllocate($captchaImage, $rred, $rgreen, $rblue); imagefttext($captchaImage, $fontSize, 0, $textX, $textY, $textColor, $font, $verify_string); $angle = mt_rand(-3, 3); $captchaImage = imagerotate($captchaImage, $angle, $backgroundColor); $line = ImageColorAllocate($captchaImage, $rred, $rgreen, $rblue); for($i = 0; $i < 10; $i++) { $xStart = mt_rand(0, $containerWidth); $yStart = mt_rand(0, $containerHeight); $xEnd = mt_rand(0, $containerWidth); $yEnd = mt_rand(0, $containerHeight); imageline($captchaImage, $xStart, $yStart, $xEnd, $yEnd, $line); } imagefilter($captchaImage, IMG_FILTER_CONTRAST, 1); //imagefilter($captchaImage, IMG_FILTER_BRIGHTNESS, 10); //imagefilter($captchaImage, IMG_FILTER_EDGEDETECT); imagefilter($captchaImage, IMG_FILTER_GAUSSIAN_BLUR); header('Content-Type:image/png'); ImagePNG($captchaImage); ?> The second issue I am having is with the BotBattle module. I have placed it into the 'modules' directory. I've attempted to go to the http://www.yoursitehere.com/index.php?mod=BotBattle&act=install link to install the BotBattle module and it doesn't bring up anything; it only seems to bring me back to the index page. Of course I change the 'yoursitehere.com' part to my own address. The link to the code is here; http://ezrpg.uaktech.net/archives/showthread.php?tid=3 Edited October 16, 2012 by dwandswforlife Quote Link to comment Share on other sites More sharing options...
Aventro Posted October 17, 2012 Share Posted October 17, 2012 Make sure you have the GD library enabled on your host. However If I were you I would just change and use reCaptcha instead. Quote Link to comment Share on other sites More sharing options...
dwandswforlife Posted October 17, 2012 Author Share Posted October 17, 2012 Okay, could you provide a link to the code and tutorial for reCaptcha? Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted October 17, 2012 Share Posted October 17, 2012 https://developers.google.com/recaptcha/docs/php 2 sec google work... Quote Link to comment Share on other sites More sharing options...
dwandswforlife Posted October 17, 2012 Author Share Posted October 17, 2012 http://lmgtfy.com/?q=reCaptcha I appreciate the assistance nonetheless. Quote Link to comment Share on other sites More sharing options...
dwandswforlife Posted October 18, 2012 Author Share Posted October 18, 2012 So I got my public and secret keys, entered all the forms both on my captcha.php page and form on the index where the registration page is, but yet the image does not load. Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted October 18, 2012 Share Posted October 18, 2012 If you do it right it works... so check carefully, and re-try. Quote Link to comment Share on other sites More sharing options...
dwandswforlife Posted October 19, 2012 Author Share Posted October 19, 2012 Well I checked and re-checked, even followed the guide once again and did it from scratch; to no avail. Also I am still experience the BotBattle issue I posted on the first post. Quote Link to comment Share on other sites More sharing options...
Aventro Posted October 20, 2012 Share Posted October 20, 2012 Well, are we suppose to guess what you have done wrong? Please provide some code, screens on the results, etcetera. Quote Link to comment 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.