Вот вам пример!!!
<?if(isset($_POST['check'])){?>
<script type="text/javascript">
setTimeout(function () {
<?
$userlogin=$_POST['login'];
$password=$_POST['password'];
$username=$_POST['username'];
$s_name=$_POST['s_name'];
$address=$_POST['address'];
$email=$_POST['email'];
$phonenumber=$_POST['phonenumber'];
db_connect();
if($filename==''){
$filename= 'no.gif';
}
$qwerty=mysql_query("INSERT INTO `users` (`login`,`password`,`name`,`image`) VALUES ('$userlogin','$password','$username','{$filename}')");
?>
}, 10000)
</script>
<?
}
?>