<?php

foreach($_GET AS $key => $value) {
${$key} = ($value);
} 
foreach($_POST AS $key => $value) {
${$key} = ($value);
}


if($action == "dologin"){

$user = file("g_file.php");

$vic=base64_decode($vi);

if(strlen($name) <= 2 && strlen($vi)<="2"){ 

}else{ 

for($x=0;$x<sizeof($user);$x++) { 

$temp = explode(";",$user[$x]); 

$opp[$x] = "$temp[0];$temp[1];$temp[2];$temp[3];$temp[4];$temp[5];$temp[6];$temp[7];$temp[8];$temp[9];$temp[10];";

$meta = base64_encode($name); 

$meta2 =$temp[0];

if($vic!=""){

$aq="$vic";

}else{

$aq= md5($password); 
$offerv=0;
setcookie("TestCookie", $offerv, time()+3); 

}$ap =$temp[1];

if($aq==$ap && $meta==$meta2 && $temp[8]=="active") { 

$hclass="active";

$hlink="Home";

$dlink="<a href=index.php?action=logout>Logout</a>";


}elseif($ap==$aq && $temp[8]=="active"){

$offerv=0;
setcookie("TestCookie", $offerv, time()+3); 

$hclass="active";

$hlink="Home";

$dlink="<a href=index.php?action=logout>Logout</a>";

}

}

}

}

elseif($action=="faq"){

$fclass="active";

$hlink="<a href=index.php?home&m=$m>Home</a>";

$dlink="<a href=index.php?action=login>Login</a>";

$clink="<a href=index.php?action=signup>Signup</a>";

$flink="FAQ";

$alink="<a href=index.php?action=contact>Contact Us</a>";

}elseif($action==""){

$hclass="active";

$hlink="<a href=index.php?home&m=$m>Home</a>";

$dlink="<a href=index.php?action=login>Login</a>";

$clink="<a href=index.php?action=signup>Signup</a>";

$flink="<a href=index.php?action=faq>FAQ</a>";

$alink="<a href=index.php?action=contact>Contact Us</a>";

}elseif($action=="login"){

$dclass="active";

$hlink="<a href=index.php?home&m=$m>Home</a>";

$dlink="Login";

$clink="<a href=index.php?action=signup>Signup</a>";

$flink="<a href=index.php?action=faq>FAQ</a>";

$alink="<a href=index.php?action=contact>Contact Us</a>";

}elseif($action=="signup"){

$cclass="active";

$hlink="<a href=index.php?home&m=$m>Home</a>";

$dlink="<a href=index.php?action=login>Login</a>";

$clink="Signup";

$flink="<a href=index.php?action=faq>FAQ</a>";

$alink="<a href=index.php?action=contact>Contact Us</a>";

}elseif($action=="contact"){

$aclass="active";

$hlink="<a href=index.php?home&m=$m>Home</a>";

$dlink="<a href=index.php?action=login>Login</a>";

$clink="<a href=index.php?action=signup>Signup</a>";

$flink="<a href=index.php?action=faq>FAQ</a>";

$alink="Contact Us";

}elseif($action=="change2" && $m!=""){

//$hclass="active";

$hlink="<a href=index.php?action=dologin&vi=$m>Home</a>";

$dlink="<a href=index.php?action=logout>Logout</a>";

}elseif($action=="see_ref" && $m!=""){

//$hclass="active";

$hlink="<a href=index.php?action=dologin&vi=$m>Home</a>";

$dlink="<a href=index.php?action=logout>Logout</a>";

}elseif($action=="change"&&$m!=""){

$hlink="<a href=index.php?action=dologin&vi=$m>Home</a>";

$dlink="<a href=index.php?action=logout>Logout</a>";

}else{

//$hclass="active";

$hlink="<a href=index.php?home>Home</a>";

$dlink="<a href=index.php?action=login>Login</a>";

$clink="<a href=index.php?action=signup>Signup</a>";

$flink="<a href=index.php?action=faq>FAQ</a>";

$alink="<a href=index.php?action=contact>Contact Us</a>";

}

include "template.html";

?>




