Location: PHPKode > scripts > Create Your Own Directory > cms/HRAS/users/getcnt.php
<?php
require_once "../../auth/config.php";
$link = mysql_connect($hostname, $username,$password);
$res=mysql_select_db($dbname,$link);
$id = $_GET['tid'];
$name1=$_GET['username'];
$id1 = $_GET['id'];
$str="select * from cntfields where catid=$id";
$re=mysql_query($str);
$sstr="<form name=fm3 method=POST action=\"addcontent.php?name=$name1&id=$id1\"  ><table bgcolor=#efefef align=center valign=top width=70% height=100% >";
$i=0;
$present=no;
while($rows=mysql_fetch_array($re,MYSQL_ASSOC))
{ 
	$catid=$rows['catid'];
	$fname=$rows['fname'];
	$inputtype=$rows['inputtype'];
	$defaultval=$rows['defaultval'];
      $present='yes';

$sstr=$sstr."<tr><td width=50%>$fname</td><td width=50%>";
if($inputtype=='selectbox')
{
	$val=explode(',',$defaultval);
	$ct=count($val);
	$sstr=$sstr."<select name=nam[$i]>";
	$tmp="";
	for($k=0;$k<$ct;$k++)
	{
		$tmp=$tmp."<option value=$val[$k]>$val[$k]</option>";
	}
	
	$sstr=$sstr.$tmp."</select></td></tr>";
}else if($inputtype=='textbox'){

$sstr=$sstr."<input type=$inputtype id=id$i name=nam[$i]  value=$defaultval></td></tr>";

}else if($inputtype=='textarea'){

$sstr=$sstr."<textarea id=id$i name=nam[$i] >$defaultval</textarea></td></tr>";

}

$i=$i+1;
}

if($present=='yes')
{
	$sstr=$sstr."<tr><td colspan=2 align=right><br><input type=submit name=submi value='Submitform'>
	<input type=hidden name=tabid value=$id>
	<input type=hidden name=id value=$id1>
	<input type=hidden name=sub value='yes'></input></td></tr><tr><td colspan=2><font color=green align=center height=200> <b>*</b>   Enter values for mandatory fields</font>
	</td></tr></table>"; 
echo"$sstr";

}else{

 echo"<font color=green>Content for the selected category is not present</font>";

}
?>


Return current item: Create Your Own Directory