日期:2012-08-07  浏览次数:20784 次

发布文章、或者新闻、或者产品说明,这一类的图片、文字均有的资料,要求的是,根据文章的需要随时插入图片、并且由其自己指定对齐方式。文字进库,图片上传?

adddata.php文件的代码:


  1<html>
  2<head>
  3<title>增加数据</title>
  4<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  5</head>
  6
  7<body bgcolor="#FFFFFF">
  8
  9
 10<?
 11@$link=mysql_pconnect("localhost","root","rpass007") or
 12die ("登陆服务器失败,请稍候再试");
 13mysql_select_db($db);
 14$date=date('Y-m-d H:i:s');
 15if((($db=="foltyx"&&$tb=="wlg_master")||($db=="foljrbd"&&$tb=="tpxw"))||($db=="foljrxt"&&($tb=="shpx"||$tb=="tswl")))//for tyx jrbd jrxt
 16{
 17        if(chop($imagein)!="none")
 18              {
 19              $picuppath="/home/fol/php/admin/";         //define up pic path
 20              $dirname="picup";
 21              if(!(chdir($picuppath)))
 22                 {
 23                    die("can not change path!");
 24                 }
 25              if(!(file_exists("$dirname")))
 26                 {
 27                    if(!(mkdir($dirname,0777))) die("can not make dir!");
 28                    if(!(chmod($dirname,0777))) die("can not change dir mode!");
 29                 }
 30              if(!(chdir($dirname))) die("can not change dir!");
 31              $dirpath=$dirname."/";
 32              $imagepath=$picuppath.$dirpath;                      //path end
 33
 34        $image="";
 35        $imagename="";
 36        $imagetype="";
 37        $nowtime=time();
 38
 39                  $imagename=$imagein_name ;                         //old pic name for db
 40                  $imagetail=strrchr($imagename,".");                //get pic name type name
 41