양식에 텍스트 영역이 있습니다. 이 양식은 제출시 일부 정보를 데이터베이스에 삽입합니다. "newsText"는 긴 텍스트이지만 짧은 문자열 만 삽입 할 수 있습니다. 나는 정확한 양의 문자로이 질문을 갱신 할 것이다.TextArea로 SQL 업데이트 - 짧은 문자열로 업데이트 만
형태 :
<form id="newsForm" action="<?php echo $uploadHandler ?>" enctype="multipart/form-data" method="post">
<div class="managementNewsTitle">
Title<br />
<input id="inputNewsTitle" name="inputNewsTitle" type="text"></input>
</div>
<div class="managementNewsTitle">
Image<br />
<input id="inputNewsFile" type="file" name="file" onchange="document.getElementById('inputNewsFilename').value = value;"><br />
Name<br />
<input id="inputNewsFilename" type="text"></input>
</div>
<div class="managementNewsTitle">
Text<br />
<textarea id="inputNewsText" name="inputNewsText"></textarea>
</div>
<input type="hidden" name="givenFileName" id="givenFileName" value="">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>">
<input type="hidden" name="newsSubmitValue" id="submitValue" value="no">
<input type="button" id="newsSubmitButton" onclick="newsSubmit()" name="submitButton" value="Save"></input>
</form>
INSERT :
if($_POST['newsSubmitValue'] === "yes") {
$newsTitle = $_POST['inputNewsTitle'];
$newsText = $_POST['inputNewsText'];
$newsImageURL = $_POST['givenFileName'];
mysql_query("INSERT INTO cs_news VALUES (DEFAULT, CURRENT_TIMESTAMP, '".$newsTitle."', '".$newsText."', 'Images/".$newsImageURL."')");
}
최저 질문 제목에 '해결 된'단어를 넣지 마십시오. 나는 그것이 나쁜 행동으로 보인 것처럼 그것을 여기에서 편집했습니다. – nickhar
답변으로 아직 답을 수락 할 수 없어서이 문제가 해결되었음을 보여주고 싶었습니다. 48 시간은 너무 많습니다. –