十万火急请PHP高手哥们帮助
fangjia
![]()
|
1#
fangjia 发表于2006-09-30
十万火急请PHP高手哥们帮助
我当了一个PHP的在线编辑器,然后吧<textarea name="content" style="display:none"></textarea>
<iframe ID="eWebEditor1" src="eWebEditor/ewebeditor.php?id=content&style=standard" frameborder="0" scrolling="no" width="600" HEIGHT="350"></iframe> 放在页面里,用DREAMWEAVER的插入行为,提示数据库里的文章内空没有存上,下面是全页面代码,请高手哥们帮忙看看问题出在什么地方了。 <?php require_once('../../Connections/databaselink.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO content (atitleid, texttitleid, texttitlename, texttime, textcontent) VALUES (%s, %s, %s, %s, %s)", GetSQLValueString($_POST['atitleid'], "int"), GetSQLValueString($_POST['texttitleid'], "int"), GetSQLValueString($_POST['texttitlename'], "text"), GetSQLValueString($_POST['texttime'], "date"), GetSQLValueString($_POST['content'], "text")); mysql_select_db($database_databaselink, $databaselink); $Result1 = mysql_query($insertSQL, $databaselink) or die(mysql_error()); $insertGoTo = "admin_ok.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } mysql_select_db($database_databaselink, $databaselink); $query_suoshulanmua = "SELECT atitleid, atitlename FROM atitle"; $suoshulanmua = mysql_query($query_suoshulanmua, $databaselink) or die(mysql_error()); $row_suoshulanmua = mysql_fetch_assoc($suoshulanmua); $totalRows_suoshulanmua = mysql_num_rows($suoshulanmua); mysql_select_db($database_databaselink, $databaselink); $query_shushulanmub = "SELECT btitleid, btitlename, atitleid FROM btitle"; $shushulanmub = mysql_query($query_shushulanmub, $databaselink) or die(mysql_error()); $row_shushulanmub = mysql_fetch_assoc($shushulanmub); $totalRows_shushulanmub = mysql_num_rows($shushulanmub); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <link href="../css/styel.css" rel="stylesheet" type="text/css" /> <title>网站后台管理系统</title></head> <body> <div id="content"> <h3>添加信息</h3> <hr /> <form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST"> <label>信息标题 <input name="texttitlename" type="text" id="texttitlename" /> </label> <label>添加时间 <input name="texttime" type="text" id="texttime" value="" /> </label> <hr /> <label>所属一级栏目 <select name="atitleid" id="atitleid"> <?php do { ?> <option value="<?php echo $row_suoshulanmua['atitleid']?>"<?php if (!(strcmp($row_suoshulanmua['atitleid'], $row_suoshulanmua['atitleid']))) {echo "selected=\"selected\"";} ?>><?php echo $row_suoshulanmua['atitlename']?></option> <?php } while ($row_suoshulanmua = mysql_fetch_assoc($suoshulanmua)); $rows = mysql_num_rows($suoshulanmua); if($rows > 0) { mysql_data_seek($suoshulanmua, 0); $row_suoshulanmua = mysql_fetch_assoc($suoshulanmua); } ?> </select> </label> <label>所属二级栏目 <select name="texttitleid" id="texttitleid"> <?php do { ?> <option value="<?php echo $row_shushulanmub['btitleid']?>"<?php if (!(strcmp($row_shushulanmub['btitleid'], $row_shushulanmub['btitleid']))) {echo "selected=\"selected\"";} ?>><?php echo $row_shushulanmub['btitlename']?></option> <?php } while ($row_shushulanmub = mysql_fetch_assoc($shushulanmub)); $rows = mysql_num_rows($shushulanmub); if($rows > 0) { mysql_data_seek($shushulanmub, 0); $row_shushulanmub = mysql_fetch_assoc($shushulanmub); } ?> </select> </label> <hr /> <label>信息内容 </label> <textarea name="content" style="display:none"></textarea> <iframe ID="eWebEditor1" src="eWebEditor/ewebeditor.php?id=content&style=standard" frameborder="0" scrolling="no" width="600" HEIGHT="350"></iframe> <hr /> <label> <input type="submit" name="Submit" value="提交" /> </label> <input type="hidden" name="MM_insert" value="form1"> </form> <p> </p> <br /> <br /> </div> </body> </html> <?php mysql_free_result($suoshulanmua); mysql_free_result($shushulanmub); ?> |