📄 upload.php
字号:
<?
include('config.inc');
If($file != "none") {
$db_connect = mysql_connect($datahost,$datauser,$datapasswd);
$base_selection = mysql_select_db($base,$db_connect);
$fp=fopen($file, "r");
while ($data = fgetcsv ($fp, 1000, ",")) {
$num = count ($data);
$path=$data[0];
$subjectid =$data[1];
$question=$data[2];
$choice1=$data[3];
$choice2=$data[4];
$choice3=$data[5];
$choice4=$data[6];
$answer =$data[7];
$date =$data[8];
$questionmaker =$data[9];
print $path."/".$filename.",".$filesize." <br>\n";
@mysql_query("insert into questionbank (subjectid,question,choice1,choice2,choice3,choice4,answer,date,questionmaker) VALUES('$subjectid','$question','$choice1','$choice2','$choice3','$choice4','$answer','$date','$questionmaker')");
}
fclose ($fp);
}
?>
<html>
<head>
<title>Successful File Upload!</title>
<body>
<h1>Success!</h1>
<P>You sent: <? echo "<b>$file_name </b>"; ?>, a <? echo "$file_size"; ?>
byte file with a mime type of <? echo "$file_type"; ?>.</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -