-5

私のコード
=========ajax.php============

$ide = $_POST['ide'];<br>
$it = $_POST['it'];<br>
$a = $_POST['a'];<br>
<br>
$json_arr = array( <br>
    "id" => "event-icoN",<br>
    "t" => $it,<br>
    "ide" => $ide,<br>
    "w" => "http://www.excellencepro.local/templates/contents/passbook/upload/event-iconi.png"<br>
);

$temp = json_encode($json_arr);
echo $temp;

move_uploaded_file($_FILES["xfile"]["tmp_name"], "upload" / $_FILES["xfile"]["name"]);

問題==============

Ajax レスポンス==

{"id":"event-icoN","t":"s","ide":"is","w":"http:\/\/www.excellencepro.local\/templates\/contents\/passbook\/upload\/event-iconi.png"}<br />
<font size='1'><table class='xdebug-error xe-warning' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Warning: Division by zero in C:\wamp\www\excellencepro\templates\contents\passbook\ajax.php on line <i>25</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0013</td><td bgcolor='#eeeeec' align='right'>680864</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\wamp\www\excellencepro\templates\contents\passbook\ajax.php' bgcolor='#eeeeec'>..\ajax.php<b>:</b>0</td></tr>
</table></font>
<br />
<font size='1'><table class='xdebug-error xe-warning' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Warning: move_uploaded_file() [&lt;a href='function.move-uploaded-file'&gt;function.move-uploaded-file&lt;/a&gt;]: Filename cannot be empty in C:\wamp\www\excellencepro\templates\contents\passbook\ajax.php on line <i>25</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0013</td><td bgcolor='#eeeeec' align='right'>680864</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\wamp\www\excellencepro\templates\contents\passbook\ajax.php' bgcolor='#eeeeec'>..\ajax.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0015</td><td bgcolor='#eeeeec' align='right'>682600</td><td bgcolor='#eeeeec'><a href='http://www.php.net/move_uploaded_file' target='_new'>move_uploaded_file</a>
(  )</td><td title='C:\wamp\www\excellencepro\templates\contents\passbook\ajax.php' bgcolor='#eeeeec'>..\ajax.php<b>:</b>25</td></tr>
</table></font>
<br />
<font size='1'><table class='xdebug-error xe-warning' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Warning: move_uploaded_file() [&lt;a href='function.move-uploaded-file'&gt;function.move-uploaded-file&lt;/a&gt;]: Unable to move 'C:\wamp\tmp\phpAC99.tmp' to '' in C:\wamp\www\excellencepro\templates\contents\passbook\ajax.php on line <i>25</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0013</td><td bgcolor='#eeeeec' align='right'>680864</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\wamp\www\excellencepro\templates\contents\passbook\ajax.php' bgcolor='#eeeeec'>..\ajax.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0015</td><td bgcolor='#eeeeec' align='right'>682600</td><td bgcolor='#eeeeec'><a href='http://www.php.net/move_uploaded_file' target='_new'>move_uploaded_file</a>
(  )</td><td title='C:\wamp\www\excellencepro\templates\contents\passbook\ajax.php' bgcolor='#eeeeec'>..\ajax.php<b>:</b>25</td></tr>
</table></font>
4

1 に答える 1

0

得られる出力は、PHP コード (具体的には C:\wamp\www\excellencepro\templates\contents\passbook\ajax.php 内) が引き起こした xdebug プリティ プリント エラーです。ゼロによる除算があるように見える 25 行目を見てください。

実際の問題は次のとおりです。

move_uploaded_file($_FILES["xfile"]["tmp_name"], "upload" / $_FILES["xfile"]["name"]);

"upload/" . [..]代わりに/、除算演算子を使用することをお勧めします。だからあなたはゼロで割っています;-)

于 2013-05-31T12:55:00.410 に答える