954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

image refresh

Hi,

i created a form that it contains some text fields which the user should fill them and in the last part i created captcha image that displaying some characters for typing inside the box then i decided to add some refresh button beside my image but the problem is here that i wanna refresh the image without reloading the page again

<?php include "../../db.php"; $id=rand(1,20); $select=mysql_query("select * from captcha where id=$id "); $result=mysql_fetch_array($select);

$captchaname=$result['name'];  $captchaimage=$result['imagename']; 
?>
<table width="207" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="186"><img src="images/<?php echo $captchaimage ?>" width="181" height="61" /></td>
    <td width="21" align="right" valign="bottom"><a href="javascript:document.location.reload();"
ONMOUSEOVER="window.status='Refresh'; return true"
ONMOUSEOUT="window.status='ah... that was good'" title="Refresh the captcha image">
<img src="../images/view-refresh.png" 
width="16" height="16" border="0" /></a></td>
  </tr>
</table>

please help me ?

mehdi.yazdani
Light Poster
25 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

If you mean that put image directly after click link or button. My advise is use jquery onclick. For example

$(document).ready(function() {
	$('#link').click($('#img').src='<?php echo $link ?>');
});//please don't copy this code. This haven't been tried yet

but if you wish to do it without click, please remove the onlick function.

lps
Junior Poster
117 posts since Jul 2011
Reputation Points: 13
Solved Threads: 22
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You