Need some help with a bit of code.

Okay so I had this captcha code and it worked for a long time then one day it stopped working. Basically what i am trying to achieve is this. When a user visits our page and wants to contact us they can send us some info using a form. There is captch on this form and it uses php to make the captcha image and to email the data to my email. Problem is the image is not showing up.
here is the html for the form [code]

Business Solutions
LOGO
			<li><a href="support.html">Support</a></li>
			<li><a href="promo.html">Promotions</a></li>
			
			<li class="selected"><a href="contact.html">Contact Us </a></li>
		</ul>
	</div>
	
</div> <!-- /#header -->
<div id="contents">
	<div class="background">
		<div id="contacts">
			<p>&nbsp;</p>
			<ul>
				<li>
				  <p>
						<b>Advantage Computer Solutions </b>
						349 Cypress Ave. Orange City, FL 32763 <br/>
						Tel: 386 - 785 - 1277 <br/>
						Toll Free: 877 - <br/>
					  Email: [email protected]</p>
				</li>
			    
			      <form name="form1" action="captchaform/captcha.php" method="post">
				  Name:
			        <label>
			        <input type="text" name="name" id="name">
			        </label>
                                        <p>
                                          <label>Phone:
                                          <input type="text" name="phone" id="phone">
                                          </label>
                    </p>
                                        <p>
                                          <label>Email:
                                          <input type="text" name="emailaddress" id="emailaddress">
                                          </label>
                                        </p>
                                        <p>
                                          <label>Message:<br>
                                          <textarea name="comment" id="comment" cols="40" rows="5"></textarea>
                                          </label>
                                        </p>
                                        <p>Please enter the security code you see below.                                               </p>
                                        <p><img src="captcha_image.php"></p>
                                        <p>
                                          <label>
                                          <input type="text" name="security" id="security">
                                          </label>
                                        </p>
                                        <p>
                                          <label></label>
                    </p>
                                        <p>
                                          <label>
                                          <input type="submit" name="submit" id="submit" value="Submit">
                                          </label>
                                        </p>
			      </form>
			    </li>
			</ul>
		</div>
	</div>
</div> <!-- /#contents -->
<div id="footer">
	<ul class="contacts">
		<h3>Contact Us</h3>
		<li><span>Email</span>
		<p>: [email protected] </p>
		</li>
		<li><span>Address</span>
		<p>: 349 Cypress Ave. Orange City, FL 32763 </p>
		</li>
		<li><span>Phone</span>
		<p>: 386-785-1277 </p>
		</li>
	</ul>
	<ul id="connect">
		<h3>Get Updated</h3>
		<li><a href="blog.html">Blog</a></li>
		<li><a href="http://facebook.com/freewebsitetemplates" target="_blank">Facebook</a></li>
		<li><a href="http://twitter.com/fwtemplates" target="_blank">Twitter</a></li>
	</ul>
	
	<span class="footnote">&copy; Copyright &copy; 2011. All rights reserved</span>
</div> <!-- /#footer -->
[/code]

this is the captcha.php file
[php]<?
// *** The CAPTCHA comparison - http://frikk.tk ***
// *** further modifications - http://www.captcha.biz ***

session_start();

// *** We need to make sure theyre coming from a posted form -
// If not, quit now ***
if ($_SERVER[“REQUEST_METHOD”] <> “POST”)
die(“You can only reach this page by posting from the html form”);

// *** The text input will come in through the variable $_POST[“captcha_input”],
// while the correct answer is stored in the cookie $_COOKIE[“pass”] ***
if ($_POST[“security”] == $_SESSION[“pass”])
{
// *** They passed the test! ***
// *** This is where you would post a comment to your database, etc ***
echo "Correct! You have passed the captcha test.

";
echo "You information input has been sent

";

   echo "This is what you sent  <br><br>";


    echo "Name: \"" . $_POST["name"] . "\" <br>";

   echo "Phone: \"" . $_POST["phone"] . "\" <br>";

    echo "Home Phone: \"" . $_POST["Homephone"] . "\" <br>";

	echo "Email Address: \"" . $_POST["emailaddress"] . "\" <br>";
	
	echo "Your Comment: \"" . $_POST["comment"] . "\" <br>";

//sends email via php to the following address
$mailuser = "[email protected]";

//echo 'default chosen address: '.$mailuser;

$header = "Return-Path: ".$mailuser."\r\n"; 
$header .= "From: form with captcha <".$mailuser.">\r\n"; 
$header .= "Content-Type: text/html;"; 
	  
$mail_body = '
Name: '.$_POST[name].' has sent his input.
Phone: '. $_POST[phone] . '<br>
Email Address: '. $_POST[emailaddress] . '<br>
Your Comment: '. $_POST[comment] . '<br>'
;	
mail ($mailuser, 'Form sent', $mail_body, $header);
     echo 'THANKS ';    

} else {
// *** The input text did not match the stored text, so they failed ***
// *** You would probably not want to include the correct answer, but
// unless someone is trying on purpose to circumvent you specifically,
// its not a big deal. If someone is trying to circumvent you, then
// you should probably use a more secure way besides storing the
// info in a cookie that always has the same name! :slight_smile: ***
echo “Sorry, you did not pass the CAPTCHA test.

”;
echo "You said " . $_POST[“captcha_input”];
echo " while the correct answer was " . $_SESSION[“pass”];

    echo "    - Please click back in your browser and try again <br><br>";

}
?>[/php]

This is the captcha img file
[php]<?
// *** CAPTCHA image generation ***
// *** http://frikk.tk ***

session_start();

// *** Tell the browser what kind of file is come’n at 'em! ***
header(“Content-Type: image/jpeg”);

// *** Send a generated image to the browser ***
die(create_image());

// *** Function List ***
function create_image()
{
// *** Generate a passcode using md5
// (it will be all lowercase hex letters and numbers ***
$md5 = md5(rand(0,9999));
$pass = substr($md5, 10, 5);

// *** Set the session cookie so we know what the passcode is ***
$_SESSION["pass"] = $pass;

// *** Create the image resource ***
$image = ImageCreatetruecolor(100, 20);

// *** We are making two colors, white and black ***
$clr_white = ImageColorAllocate($image, 255, 255, 255);
$clr_black = ImageColorAllocate($image, 0, 0, 0);

// *** Make the background black ***
imagefill($image, 0, 0, $clr_black);

// *** Set the image height and width ***
imagefontheight(15);
imagefontwidth(15);

// *** Add the passcode in white to the image ***
imagestring($image, 5, 30, 3, $pass, $clr_white);

// *** Throw in some lines to trick those cheeky bots! ***
imageline($image, 5, 1, 50, 20, $clr_white);
imageline($image, 60, 1, 96, 20, $clr_white);

// *** Return the newly created image in jpeg format ***
return imagejpeg($image);

// *** Just in case... ***
imagedestroy($image);

}
?>[/php]

Could someone please tell me why my image is not showing up? Thanks!

It worked but now it doesnt. Can anyone tell me what is going on. This is the website www.acs2tes.com Thanks!

Sponsor our Newsletter | Privacy Policy | Terms of Service