as follows
Files to upload:
Upload Image:
Click browse to upload a local file
i am passing the txtfileupload in a page like this following way
i am unable to display the type of the file extension of the file uploaded and not able to insert in the database and hence i am unable to get the output of image file in the page
";
print $typ." type";
$chars = split("/",$typ);
print $chars[1]." type";
require_once("lib/properties.php");
require_once("lib/configure.php"); //for the rights constans.
session_start();
$title=$_REQUEST['textarea2'];
$uid= $_SESSION['loguid'];
if($uid=='')
{
$_SESSION['loguid']="Guest";
$uid= $_SESSION['loguid'];
}
if( $_SESSION['languageid']=='')
{
$_SESSION['languageid']=2;
$languageid= $_SESSION['languageid'];
}
else
$languageid=$_SESSION['languageid'];
$vid=$_REQUEST['visionid'];
$_SESSION['id']= $vid;
$menuid=$_SESSION['id'];
$ob=new Properties;
$ob->openDB();
$ob->seluccassDB();
$qry = "select max(categories_id) from categories";
$res = mysql_query($qry);
$row = mysql_fetch_row($res);
$date1= date("Y
$id = $row[0];
$id1= $id+1;
$qry2 = sprintf("update categories set categories_id='%s'",$id1);
mysql_query($qry2);
$docroot=$_SERVER['DOCUMENT_ROOT'];
$path=pathinfo($_SERVER['PHP_SELF']);
$imgpath=$docroot.$path["dirname"];
$fname=$imgpath."/kk".$id.".".$chars[1];
print $fname;
$fname1="kk".$id.".".$chars[1];
move_uploaded_file($st,$fname);
$selqry="select * from languages";
$rslang=mysql_query($selqry);
while($rowlang=mysql_fetch_array($rslang,MYSQL_BOTH))
{
$langid=$rowlang['languages_id'];
$insqry=sprintf("insert into categories(categories_id,categories_image,date_added,title) values('%s','%s','%s','%s')",$id1,$fname1,$date1,$title);
print $insqry;
mysql_query($insqry);
$insqry1=sprintf("insert into categories_description(categories_id,language_id) values('%s','%s')",$id1,$langid);
//print $insqry1;
mysql_query($insqry1);
}
print "";
print "";
print " ";
print "Title : . $title";
print " ";
?>
anybody please give me reply immediately
thanks in advance
saigopal

