Jump to content

Recommended Posts

So I am creating a new website that allows users to click on an image and submit a form. I am using ajax so the individual doesn't have to load different page. However, I am in a small hiccup that whenever the individual hits the image and tries to submit the form, the form doesn't go through as the Ajax is blocking it.
 
Pleae see the following:

<div id="message">Click below to start searching.</div> <br>
<a href='javascript:void(0);' onClick="load('content', 'm_jax.php?id=2&do=search');"><img src='map1.png' style='border: 1px solid black;' /></a>

if (isset($_POST['submit'])){
echo hello;
}

$input = array("1", "10", "13", "123", "163","540","624");

$nb_value = 1;
srand ((float) microtime() * 10000000);
$random_id_length = 20; 
$rnd_id = crypt(uniqid(rand(),1)); 
$rnd_id = strip_tags(stripslashes($rnd_id)); 
$rnd_id = str_replace(".","",$rnd_id); 
$rnd_id = strrev(str_replace("/","",$rnd_id)); 
$rnd_id = substr($rnd_id,0,$random_id_length); 
$rand_keys = array_rand($input, $nb_value); 
$rand1=$input[$rand_keys];
$rand= mysql_query("Select * from items where id='$rand1'");
$rand1=mysql_fetch_array($rand);
?>
<b>You have found an <?php echo $rand1[item];?></b>
<br><br>
<img src="<?php echo $rand1[id];?>.png">

<form action='' method='post'>
<input type='hidden' name='value' value='12' />
<input type='hidden' name='code' value='$rnd_id ' />
<input type='submit' name='enter' value='Catch Item!'/>
</form>
<?php
}
?>
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.