Location: PHPKode > scripts > Create Your Own Directory > cms/admin/defaultval.php
<?php
include "authheader.php";
if($block != true)
{
?>
<!-- Welcome to the scripts database of HIOX INDIA      -->
<!-- This tool is developed and a copyright             -->
<!-- product of HIOX INDIA.				        -->
<!-- For more information visit http://www.hscripts.com -->
<html>
<head>
</head>
<body style="margin: 0px;">
<?php include "heade.php" ?>

<table width=80% height=100% border=0 cellpadding=0 cellspacing=0 align=center>
<tr><td align=center>
<tr ><td class=maintext valign=top>
<html>
<br>
<script language='javascript'>
function addvalue()
{
document.frm.hidd.value="insert";
}

function deletevalue()
{
document.frm.hidd.value="delete";
}

</script>


<?php
$userdomain=$_POST['userdomain'];
$layout=$_POST['layout'];
$mailid=$_POST['mailid'];
$hidd=$_POST['hidd'];
if($hidd=="insert")
{
	if($layout!="" && $mailid!="" && $userdomain!=""){
             $record="nopresent";
		$query="select * from defaulttab";
		$result=mysql_query($query,$link);
		if($row=@mysql_fetch_array($result, MYSQL_ASSOC))
 		{
                   $record=$row['mailid'];
				
		
            }    

 	      if($record=="nopresent")
            {
			$qry="insert into defaulttab values($layout,'$mailid','$userdomain')";
			$res=mysql_query($qry,$link);
			if($res)
			{
				echo"<div style='color:green;' align=center>Your Values is inserted</div>";
			}
			else{
				echo"<div style='color:red;' align=center>Enter proper values</div>";
			}
		

   		}else{
		echo"<div style='color:red;' align=center>Default Values already inserted, you can only delete and insert new values</div>";
		}

	}else{
		echo"<div style='color:red;' align=center>Enter proper values</div>";
	}	
}else if($hidd=="delete")
{
	$query="delete from defaulttab";
		$result=mysql_query($query,$link);
		if($result)
 		{
			echo"<div style='color:green;' align=center>Your Default values is delted</div>";

            } else
		{
			echo"<div style='color:red;' align=center>Enter proper values</div>";

		}

}


?>


<table align=center border=0 bgcolor=#f8f8ff width=100% ><form method=POST name=frm action="">
<tr><td colspan=2 height=50 align=center><strong>DEFAULT SETTINGS</strong></td></tr>
<tr><td  style='padding-left:20px;' width=40% height=50 >Enter layout</td><td><select name=layout >
<?php
if($layout==1)
	$sel1="selected";
else
	$sel2="selected";

?>
<option value=1 <?php echo($sel1); ?> > 1</option>
<option value=2 <?php echo($sel2); ?>>2</option </td></tr>
<tr><td height=50  style='padding-left:20px;' > Enter Admin Mailid<div style='color:green;'>(hide@address.com)</div></td><td valign=top><input type=textbox name=mailid value=<?php echo($mailid);?> ></input></td></tr>
<tr><td height=50  style='padding-left:20px;' > Enter Domain Name <div style='color:green;'>(domainname.com)</div></td><td valign=top><input type=textbox name=userdomain value=<?php echo($userdomain);?> ></input></td></tr>
<tr><td height=50 colspan=2 align=center > <input type=submit value=ADD name=add onclick=addvalue()><input type=submit name=del value=DELETE onclick=deletevalue()><input type=hidden name=hidd></td></tr>
<tr><td height=50 colspan=2 > </td></tr>

</form>
</table>
</td></tr>
</table>
<tr><td height=20 bgcolor=white>
</td></tr></table>
</body>
</html>
<!-- Welcome to the scripts database of HIOX INDIA      -->
<!-- This tool is developed and a copyright             -->
<!-- product of HIOX INDIA.				        -->
<!-- For more information visit http://www.hscripts.com -->
<?php
}
?>




 
Return current item: Create Your Own Directory