このままスタックして、アップロードのw3schoolsバージョンから試してみましたが、行ってはいけません。PHPアップロードファイル、ファイルURLをMySQLに保存
マイ_events.phpスクリプトは、ファイルの情報を取得するには、以下が含まれます。
<input name="event_image" type="file" />
マイ_eventscreate.phpスクリプトは、かつて私は、URLたいアップロード、私の_gallery /ディレクトリにファイルをアップロードする方法はありません私のデータベースに保存されるファイルに追加します(SQLクエリを参照)。
<?php // Get Event ID
$location=$_GET['location'];
// Get values from form
$event_name=$_POST['event_name'];
$event_description=$_POST['event_description'];
$event_date=$_POST['event_date'];
$event_time=$_POST['event_time'];
$event_cost=$_POST['event_cost'];
$event_image=$_POST['event_image'];
// Connection to MySQL Database.
include ('_includes/_dbconnection.php');
include ('_includes/_dbopen.php');
// Update Event using Event ID.
$sql="INSERT INTO b_events (ename, edescription, edate, etime, ecost, locationid, eimage)VALUES('$event_name', '$event_description', '$event_date', '$event_time', '$event_cost', '$location', '$event_image')";
$result=mysql_query($sql);
if($result){
header('Location: _events.php');
}
else {
header('Location: _home.php');
}
?>
URLによって
あなたのajaxコードを表示できますか? –
$ _FILES http://php.net/manual/en/reserved.variables.files.phpを使用する必要があることがわかっていない場合は、ajaxで処理したコードブロックを貼り付けますか? – encodes