doulouli8686
2017-07-14 03:11
浏览 47
已采纳

在脚本中调用函数到php

Anyone know how to call goBack() in php?

It keep telling me:

Fatal error: Call to undefined function goBack()

and I don't know why..

Here is my PHP Code:

<?php
include "config.php";
include "session_user.php";
?>
    <script>
        function goBack(){
            alert();
            window.history.go(-1);
        }

    </script>

    <?php
    if(isset($_GET['d'])):

         $stmt = $mysqli->prepare("DELETE FROM bom_equipment WHERE bom_eqp_id=?");
         $stmt->bind_param('s', $id);

         $id = $_GET['d'];

         if($stmt->execute()):
             goBack();
         else:
              echo "<script>alert('".$stmt->error."')</script>";
         endif;
    endif;
    ?>

Any suggestion?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题