我正在尝试为我的网站构建图像上传,我只有以下内容,根本没有输出,但我的页面渲染还好吗?谁能看到我哪里出错了?\
//if they DID upload a file...
if($_FILES['profile_image']['name'])
{
//if no errors...
if(!$_FILES['profile_image']['error'])
{
//now is the time to modify the future file name and validate the file
$new_file_name = strtolower($_FILES['profile_image']['tmp_name']); //rename file
if($_FILES['profile_image']['size'] > (1024000)) //can't be larger than 1 MB
{
$valid_file = false;
$message = 'Oops! Your file\'s size is to large.';
}
//if the file has passed the test
if($valid_file)
{
//move it to where we want it to be
move_uploaded_file($_FILES['profile_image']['tmp_name'], 'uploads/'.$new_file_name);
$message = 'Congratulations! Your file was accepted.';
}
}
//if there is an error...
else
{
//set that to be the returned message
$message = 'Ooops! Your upload triggered the following error: '.$_FILES['profile_image']['error'];
}
}
else {
echo 'success';
}
<form method="post" action="./process-signup.php" enctype="multipart/form-data" >
<input type="file" class="profile_image text-input" name="profile_image" placeholder="Upload a picture"/><br />
<input type="submit" id="signup-com-btn" value="Complete Signup" />
</form>