<?php
include('header.php');
foreach($_POST as $key => $value) {
$protectie[$key] = filter($value);
}if(isset($_POST['submit']) && $_POST['type'] == "facebook") {
$num1 = mysql_query("SELECT * FROM `facebook` WHERE `facebook`='{$protectie['url']}'");
$num = mysql_num_rows($num1);
if($num > 0){
$mesaj = "<div class=\"msg\"><div class=\"error\">Facebook Pages has been added before!</div></div>";
}else{
mysql_query("INSERT INTO `facebook` (user, facebook, title, points, cpc) VALUES('{$data->id}', '{$protectie['url']}', '{$protectie['title']}', '{$protectie['points']}', '{$protectie['cpc']}') ");
mysql_query("UPDATE `users` SET `coins`=`coins`-'{$_POST['coins']}' WHERE `id`='{$data->id}'");
$mesaj = "<div class=\"msg\"><div class=\"success\">Facebook Pages added successfuly!</div></div>";
}}?>
<div class="block medium right">
<div class="top"><?if(isset($data->login)) {?>
<h1>Add Facebook Pages</h1>
</div>
<div class="content"><? echo $mesaj; ?>
<form method="post">
<fieldset>
<p>
<label>Sites</label><br/>
<label class="radio"><input type="radio" name="type" value="facebook" checked="checked" />Facebook Pages</label>
</p>
<p>
<label>Link</label> <small class="above">Link</small><br/>
<input class="text big" type="text" value="http://" name="url" />
</p>
<p>
<label>Title</label> <small class="above">Title</small><br/>
<input class="text big" type="text" value="" name="title" maxlength="30" />
</p>
<p>
<label>Credit</label>
<input type="text" class="text big" name="points" value="10">
</p>
<p>
<label>Coins</label>
<input type="text" class="text big" name="coins" value="10">
</p>
<p>
<label>CPC</label> <br/>
<select class="styled" name="cpc">
<option value="1">1 Coin</option>
<option value="2">2 Coin</option>
<option value="3">3 Coin</option>
<option value="4">4 Coin</option>
<option value="5">5 Coin</option>
</select>
</p>
<p>
<input type="submit" class="button gray small" value="Tambah" name="submit" />
</p>
</fieldset>
</form>
<?}else{?><script>document.location.href='index.php'</script><?}?>
</div>
</div>
<?include('footer.php');?>
How to combine line 11 and 12 = line 36 and 40? Thanks in advance.