Couldn't you just echo the forms the same way you echo'd the javascript?
<?php
if($dun==0){
echo '
<form name="form1"><input type="submit" name="submit1" /></form>
';
}
else if($toplam==0){
echo '
<form name="form2"><input type="submit" name="submit2" /></form>
';
}
else if($toplam==$dun){
header('Location: member.php');
}else{
echo "<script> alert('Error.');history.go(-1);</script>";
}
?>
And if you wanted to insert data into your database depending on the if statements then you could add functions:
<?php
function doForm1(){
//MYSQL HERE
}
function doForm2(){
//MYSQL HERE
}
if($dun==0){
echo '
<form name="form1"><input type="submit" name="submit1" /></form>
';
doForm1();
}
else if($toplam==0){
echo '
<form name="form2"><input type="submit" name="submit2" /></form>
';
doForm2();
}
else if($toplam==$dun){
header('Location: member.php');
}else{
echo "<script> alert('Error.');history.go(-1);</script>";
}
?>
$dunand what is$toplam?