$aaa = uniqid();
$Image_New_Name = $aaa."_".basename($_FILES["fileToUpload"]["name"]);
$target_dir = "upload/".$Image_New_Name;
if(isset($_POST['submit'])) {
//$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_dir)) {
echo "The file ". basename($_FILES["fileToUpload"]["name"]) ." has been uploaded.";
echo "<br/>";
}
$id = $_POST['id'];
$fullname = $_POST['fullname'];
$password = $_POST['password'];
$email = $_POST['email'];
$gender = $_POST['gender'];
$about_me = $_POST['about_me'];
$state = $_POST['state'];
$country = $_POST['country'];
if($_FILES["fileToUpload"]["name"] != "") {
$image = $_FILES["fileToUpload"]["name"];
} else {
$image='BlankFaceGraphic.jpg';
}
$sql="insert into register(id,fullname,password,email,gender,about_me,state,country,image)
values
('$id','$fullname','$password','$email','$gender','$about_me','$state','$country','$Image_New_Name')";
あなたの質問です一意のファイル名を生成する方法や、 'move_uploaded_file'コールにどこに置くかについては? – bfavaretto
私はuniqid関数を置く場所を尋ねています。 – user981053
さて、@Connunは答えを – bfavaretto