如果交的作业是文字的,可以使用文本域表单提交;
如果交上机做的程序就要使用file,表单提交;
其实原理都是一样的,
将所提交的数据保存在数据库中,如果是文件就要传到服务器上保存。
这个应该会做吧$insertSQL = sprintf("INSERT INTO news (title, title_short, sohu_url, content, intime, author) VALUES (%s, %s, %s, %s, %s, now(), %s)",
                       GetSQLValueString($HTTP_POST_VARS['title'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['title_short'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['sohu_url'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['content'], "text"),
                       GetSQLValueString($HTTP_POST_VARS['author'], "text"));mysql_select_db($database_conn, $conn);
$Result1 = mysql_query($insertSQL, $conn) or die(mysql_error());

解决方案 »

  1.   

    $insertSQL = sprintf("INSERT INTO news (title, title_short, url, content,  intime, author) VALUES (%s, %s, %s, %s, now(), %s)",$HTTP_POST_VARS['title'],$HTTP_POST_VARS['title_short'],$HTTP_POST_VARS['url'], $HTTP_POST_VARS['content'],$HTTP_POST_VARS['author']);mysql_select_db($database_conn, $conn);
    $Result1 = mysql_query($insertSQL, $conn) or die(mysql_error());