Godaddy 서버에 이상한 문제가 있습니다. 나는 Godaddy와 Hostgator 서버에 같은 스크립트를 업로드했다. Hostgator에서는 매력처럼 작동하지만 Godaddy에서는 작동하지 않습니다.PHP : godaddy의 배열 값을 사용한 양식 게시 문제
<?php
if(!$_POST['customer_name']){
?>
<form action="" enctype="multipart/form-data" method="POST">
Name: <input type="text" name="customer_name" />
Age: <input type="text" name="customer_data['age']" />
<input type="file" name="attach" />
<input type="submit" value="Send" />
</form>
<?php
}
else{
$ftmp = $_FILES['attach']['tmp_name'];
$loc = date('h-i-s_').$_FILES['attach']['name'];
move_uploaded_file($ftmp, $loc);
mail('[email protected]', $_POST['customer_data']['age'], 'hello');
}
?>
Hostgator의 경우 : http://satsai.com/mm/form.php
GoDaddy이에 : http://aristocratsfashion.com/kazi/form.php
문제는 파일 업로드하지입니다 여기 내 코드입니다. 동시에 enctype="multipart/form-data"
과 name="customer_data['age']"
을 모두 사용하면 문제가 발생합니다. 그 중 하나를 제거하면 작동합니다. 이상한 일은 Hostgator에서 작동 중입니다
문제의 코드를 게시하십시오. Pastebin이 현재 작동하지 않습니다. –
또한 어떤 오류가 발생하는지 자세히 설명하십시오. – madforstrength
다음을 확인하십시오. 1) 파일 업로드 디렉토리가 쓰기 가능합니다. 2) php config에서'upload_max_filesize'와'post_max_size'가 파일 업로드 요구 사항을 충족 시키도록 올바르게 설정되어 있습니다. –