i have a problem in sharing a file to other user
here is my code i get lag when i press the share submit button.
share.php
<form action="sharefile.php" method="post">
<p><strong>Enter Jum/Email ID:</strong></p>
<textarea name="share" style="width: 400px; height: 60px;"></textarea>
<p>(Jum ID or Primary Email separated by comma)</p>
<input type="submit" name="submit" value="Share" />
<input type="hidden" name="fileid" value"<?php echo $id; ?>" />
</form>
sharefile.php
<?php
session_start();
include ('dbconnect.php');
$userid = $_SESSION['id'];
$id = $_POST['fileid'];
$getfile = mysql_query("Select * from try where id ='$id'");
$row = mysql_fetch_array($getfile);
$name = $row['name'];
$mime = $row['mime'];
$size = $row['size'];
$data = $row['data'];
$date = $today = date("F j, Y");
$send = $_POST['share'];
$sendmany = explode(',', $send);
for ($counter=0; $counter<$sendmany; $counter++)
{
$sendmany[$counter] = trim($sendmany[$counter]);
$sql = mysql_query("Select * from user where email='$sendmany' or username='$sendmany'");
if (mysql_num_rows($sql) > 0)
{
$send = mysql_query("Insert into try (name, mime, size, data, userid, date) Values ('$name', '$mime', '$size', '$data', '$userid', '$date'");
}
}
if ($send)
{
echo 'wow';
}
?>