<?php
include("connect.php");
$styleid = intval($_POST['styleid']);
$page = $_POST['page'];
if(isset($_POST['stylecahnge'])){
$sql = mysql_query ("SELECT * FROM pathstyle where active='1' AND id='$styleid'");
$s = mysql_fetch_array($sql);
$spath = $s['pathfolder'];
$check = file_exists($spath);
if(!$check){
echo $LANGAUGE[169];
echo "<META HTTP-EQUIV='refresh' CONTENT='2; URL=$page' />";
}else{
setcookie("stylepath","$spath",time()+86400);
echo "<META HTTP-EQUIV='refresh' CONTENT='1; URL=$page' />";
}

}else{
echo "<META HTTP-EQUIV='refresh' CONTENT='1; URL=index.php' />";
}
?>