一旦值提交到 php.ini 中的数据库,我有下面的代码重定向到同一页面。在重定向之前,它必须打印提交值的 js 警报。使用下面的代码,它只是重定向但不打印警报。请告诉我代码中的问题在哪里。
if ($runsql)
    {
        do_alert ("Profile for ".$student_pet_name." Saved Successfully");
        header('Location: student_detail_entry.php');   
    }
    else
    {
        echo "Error in Submitted Value ". mysql_error();
    }
我的 do_alert 功能是
function do_alert($msg) 
    {
        echo '<script type="text/javascript">alert("' . $msg . '"); </script>';
    }
谢谢...