我想註冊後用戶發送到有個人資料的網站註冊後,配置文件,但我沒有得到任何輸入文件 不知道我做錯了,但我開始在ELS語句會不知道這是寫有人可以幫助我也許重定向到使用PHP
<?php
// set database connection
require("dbconfig.php");
// lets get our posts //
$email = $_POST['email'];
$pass = $_POST['password'];
$bn = $_POST['bandname'];
$state = $_POST['state'];
$genre = $_POST['genre'];
$description = $_POST['description'];
$image = $_FILES['image'];
/// valid image types ///
$image_type = array("image/jpg","image/jpeg","image/bmp","image/gif","image/png");
/// folder that will hold the image
$imagepath = "images/";
$imagepath .= $image["name"];
// move the file from the tmp folder to the image folder
if (move_uploaded_file($image['tmp_name'], $imagepath)){
$foo = `mogrify -quality 92 -scale 500x $imagepath`;
}
// insert data into mysql
$sql = "insert into dbusers (email, password, bandname, state, genre, description , image)
values ('$email','$pass','$bn ','$state','$genre','$description','".$image['name'] . "')";
if (!mysql_query($sql)){
die('ERROR' . mysql_error());
}else {
$id=mysqli_insert_id($sql); // Get the associated ID number
// Set up a login session
session_start();
$_SESSION ['id' ] = $id;
$_SESSION ['bandname' ] = $bandname;
$_SESSION ['password' ] = $password;
header ("Location:ympprofile.php?listid=$id");
}
?>
插入行的ID檢查你的代碼中的其他部分執行,如果沒有,那麼請檢查您的MySQL查詢 – manuyd 2014-12-06 05:38:08