文本输入和$ _FILES变量没有回显

时间:2013-01-19 11:01:22

标签: php javascript

我想知道在下面的代码中在echo中显示文本输入的正确方法是什么,因为没有输出任何内容:

<script language="javascript" type="text/javascript">
  window.top.stopVideoUpload(
    <?php echo $result; ?>,
    '<?php echo "<input name='vidid' type='text' value='$id'/> " . $_FILES['fileVideo']['name'] ?>'
  );
</script>  

另一种不起作用的尝试:

<script language="javascript" type="text/javascript">
  return window.top.stopVideoUpload(
    <?php echo $result; ?>,
    '<?php echo "<input name='vidid' type='text' value='".$id."'/>" . $_FILES['fileVideo']['name']; ?>'
  );
</script>

更新

<script language="javascript" type="text/javascript">
  window.top.stopVideoUpload(
    <?php echo $result; ?>,
    '<?php echo "<input name='vidid' type='text' value='".$id."'/>" . $_FILES['fileVideo']['name']; ?>'
  );
</script>

我收到的错误是:syntaxError: missing ) after argument list.

1 个答案:

答案 0 :(得分:0)

<script language="javascript" type="text/javascript">return window.top.stopVideoUpload(<?php echo $result; ?>, <?php echo "<input name='vidid' type='text' value='$id'/> " . $_FILES['fileVideo']['name']; ?>');</script>