如何在 PHP 中显示警告框? [英] How to show an alert box in PHP?
本文介绍了如何在 PHP 中显示警告框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用 PHP 显示一个显示消息的警告框.
I want to display an alert box showing a message with PHP.
这是我的 PHP 代码:
Here is my PHP code:
<?php
header("Location:form.php");
echo '<script language="javascript">';
echo 'alert(message successfully sent)'; //not showing an alert box.
echo '</script>';
exit;
?>
但它不起作用.
推荐答案
使用此代码
echo '<script language="javascript">';
echo 'alert("message successfully sent")';
echo '</script>';
问题是:
- 你错过了
"
- 应该是
alert
而不是alery
这篇关于如何在 PHP 中显示警告框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文