I have this script:
$amm="$p->points";
if ($amm> $u->hits){
$message= "You don't have referral hits!";
}elseif ($amm <= $u->hits = "picture.php")
{
Its shows the message you dont have referral hits, BUT also opens up the other php link.
how can i stop this from happening so that it only opens picture.php if there are 5 referrals.
i ill post the whole code section of it below here:
<?
include "inc/functions.php";
$r=$_GET['r'];
$p=$_GET['p'];
$querys2=mysql_query("SELECT * FROM prizes LIMIT 1");
$p2 = mysql_fetch_object($querys2);
if (empty($p['p'])){
$p=$p2->id;
}
$sql_p_checkp = mysql_query("SELECT id FROM prizes WHERE id='$p'");
$ip_checkp = mysql_num_rows($sql_p_checkp);
if($ip_checkp > 0){
}else{
$p=$p2->id;
}
$querys=mysql_query("SELECT * FROM prizes WHERE id='$p' LIMIT 1");
$p = mysql_fetch_object($querys);
$sql_ip_check2 = mysql_query("SELECT ip FROM user WHERE ip='$ip'");
$ip_check2 = mysql_num_rows($sql_ip_check2);
if($ip_check2 > 0){
}else{
mysql_query("UPDATE user SET hits =hits+1 WHERE id='$r'");
}
$sql_ip_check = mysql_query("SELECT ip FROM user WHERE ip='$ip'");
$ip_check = mysql_num_rows($sql_ip_check);
if($ip_check > 0){
$message="";
}else{
mysql_query("INSERT INTO user (`id` , `ip` , `hits`)
VALUES ('', '$ip', '0')") or die (mysql_error());
echo"<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"0\">";
}
$page=$p->id-1;
$page2=$p->id+1;
if (($_POST['reqp'])){
$email=mysql_real_escape_string(strip_tags($_POST['email']));
mysql_query("INSERT INTO requests (`id` , `ip` , `desc`, `email`)
VALUES ('', '$ip', '$p->desc', '$email')") or die (mysql_error());
mysql_query("UPDATE user SET hits =hits-$p->points WHERE ip='$ip'");
$message="Your prize has been requested and will be sent soon!";
}
if (($_POST['req'])){
$amm="$p->points";
if ($amm> $u->hits){
$message= "You don't have referral hits!";
}elseif ($amm <= $u->hits = "picture.php")
{
$message="<input id=\"email\" name=\"email\" value=\"Email\" onClick=\"clsv(this);\" type=\"text\"/>
<input type=\"submit\" name=\"reqp\" id=\"reqp\" value=\"Request Prize\">
$s->cpa
";
}}
?>