Hi guyz
I’m making a contact form which has name, address, etc… and a captcha field at the bottom of the form before the submit button. i am working on my local computer, everything works fine, no problem at all.
Now, after a I uploaded my files to the actual site, it’s just so strange that my captcha image isn’t displaying on where it has to be.
The form is on an HTML page, contact.htm:
Here’s the code for my form…
<form name="myform" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
<table border="0" width="100%" cellpadding="0" style="border: 1px solid #ededed; border-collapse: collapse" height="322" id="send">
<tr>
<td width="100%" colspan="3" height="24" bgcolor="#F2F9F2">
<p style="margin-left: 10px"><strong>
<font face="Tahoma" size="2">Send us
your comments and suggestions</font></strong></td>
</tr>
<tr>
<td colspan="3"><font size="1"> </font></td>
</tr>
<tr>
<td colspan="3" style="list-style: none;"><font style="font-size: 8pt;" face="Tahoma" color="#ff0000">
<div id='myform_errorloc'></div></font>
</td>
</tr>
<tr>
<td width="24%" align="right">
<p style="margin-right: 20px">
<font face="Tahoma" style="font-size: 9pt">
Name</font></td>
<td colspan="2">
<input type="text" name="name" value="<?php echo htmlentities($name); ?>" size="55" style="font-family: Tahoma; font-size: 9pt" id="name"></td>
</tr>
<tr>
<td width="24%" align="right">
<p style="margin-right: 20px">
<font face="Tahoma" style="font-size: 9pt">
Email</font></td>
<td colspan="2">
<input type="text" name="email" value="<?php echo htmlentities($email); ?>" size="55" style="font-family: Tahoma; font-size: 9pt" id="name0"></td>
</tr>
<tr>
<td width="24%" align="right">
<p style="margin-right: 20px">
<font face="Tahoma" style="font-size: 9pt">
Address</font></td>
<td colspan="2">
<input type="text" name="address" value="<?php echo htmlentities($address); ?>" size="55" style="font-family: Tahoma; font-size: 9pt" id="name2"></td>
</tr>
<tr>
<td width="24%" align="right">
<p style="margin-right: 20px">
<font face="Tahoma" style="font-size: 9pt">
Contact No.</font></td>
<td colspan="2">
<input type="text" name="contact" value="<?php echo htmlentities($contact); ?>" size="55" style="font-family: Tahoma; font-size: 9pt" id="name1"></td>
</tr>
<tr>
<td width="24%" align="right" valign="top" height="88">
<p style="margin-right: 20px">
<font face="Tahoma" style="font-size: 9pt">
Message</font></td>
<td valign="top" height="88" colspan="2">
<textarea rows="6" name="message" cols="52" style="font-family: Tahoma; font-size: 9pt" id="message"><?php echo htmlentities($message); ?></textarea></td>
</tr>
<tr>
<td width="24%" align="right" valign="top" height="24"> </td>
<td width="21%" height="24">
<img src="functions/captcha_code_file.php?rand=<?php echo rand(); ?>" id='captchaimg' >
</td>
<td height="24" width="54%">
<font face="Tahoma" style="font-size: 8pt" color="#444444">
Can't read the image? </font>
<font face="Tahoma" style="font-size: 8pt" color="#FF0000">
<a href="javascript: refreshCaptcha();">
<font color="#FF0000">Click here</font></a></font></td>
</tr>
<tr>
<td width="24%" align="right" valign="top" height="10"></td>
<td colspan="2" height="10">
<font face="Tahoma" style="font-size: 8pt" color="#444444">
Enter the code above here</font></td>
</tr>
<tr>
<td width="24%" align="right" valign="top" height="20"> </td>
<td colspan="2" height="20">
<input type="text" name="6_letters_code" size="22" style="font-family: Tahoma; font-size: 9pt" id="6_letters_code"></td>
</tr>
<tr>
<td width="24%" align="right" valign="top"> </td>
<td colspan="2">
<input type="submit" value="Send" name="sendBtn" style="font-family: Tahoma; font-size: 8pt"></td>
</tr>
<tr>
<td width="24%" align="right" valign="top" height="19"> </td>
<td colspan="2" height="19"> </td>
</tr>
</table>
</form>
This is the source of my captcha image inside the form…
<img src="functions/captcha_code_file.php?rand=<?php echo rand(); ?>" id='captchaimg' >
The captcha_code_file.php will just produce the image.
I’m using .htaccess to read php scripts in html… here’s my .htaccess code…
AddType application/x-httpd-php .htm .html
all php scripts are running but only this captcha codes isn’t doing right.
any help is greatly appreciated…thank you.