Uploadify를 사용하여 이미지를 업로드하고 있습니다. 이제 올바른 업로드 경로를 얻어야합니다.javascript/jQuery와 PHP 결합
I가 다음 코드/스크립트
<?php
$uploadifyPath = get_bloginfo('url') . '/wp-content/plugins/uploadify/';
$galleryPath = "'".getGalleryURL('1620')."'"; // <--- 1620 is inputed by me.
?>
<input id="galleryID" type="hidden" value="1620" name="galleryID"/>
<input id="fileInput" name="fileInput" type="file" />
<script type="text/javascript">// <![CDATA[
$(document).ready(function() {
$('#fileInput').uploadify({
'uploader' : '<?php echo $uploadifyPath ?>uploadify.swf',
'script' : '<?php echo $uploadifyPath ?>uploadify.php',
'cancelImg' : '<?php echo $uploadifyPath ?>cancel.png',
'auto' : true,
'folder' : <?php echo $galleryPath ?>
});
});
// ]]></script>
어떻게, jQuery를 함께 내 기능 getGalleryURL()
에 galleryID의 값과 입력을받을 수 있나요?
또는 ...이 작업을 수행하는 더 좋은 방법은 무엇입니까 ??
jquery가 약간의 작업을 할 때 이미 요청이 서버에서 반환되었으며 PHP는 이미 작업을 완료했습니다. 1620을 galleryID 입력에 어떻게 집어 넣고 있습니까? – Galen
텍스트 검색 상자에서 Autocomplete를 사용할 때 galleryID가 jQuery에서 값을 가져옵니다. – Steven