dtv995719 2013-12-13 13:31
浏览 20
已采纳

在PHP的同一页面上显示java脚本的警报[关闭]

i am trying to show an alert of java script on a same i mean the below code

echo "<script type='text/jscript'>alert('Wrong Email!!.')</script>";

for example after checking the form if something wrong this message appear on the same page ,right now i can handle this message on a blank page & after that again with redirect code redirect to the same page ,but this is not the one which i want !!! i want this message appear on the same page of P H P.

  • 写回答

2条回答 默认 最新

  • douheng8629 2013-12-13 14:03
    关注

    i find the solution for this problem I,MYSELF. we can send the submit values to another page but after checking in that page you can send back a value & result by query into the same page & show up the result ..look!

    if($email=null){
    

    echo ("document.location.href='../home.php?result=wrong';"); }

    and on home page you can show the message like this !

    if(isset($_GET['result'])){if($_GET['result']==wrong){ echo "<script
    type='text/jscript'>alert('Wrong Email!!.')</script>";}}
    

    That's it !!;)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 有偿求数字经济对经贸的影响机制的一个数学模型,弄不出来已经快要碎掉了
  • ¥15 这个公式写进SIMULINK中的function模块的代码中应该是什么样的
  • ¥15 javaweb登陆的网页为什么不能正确连接查询数据库
  • ¥15 数学建模数学建模需要
  • ¥15 已知许多点位,想通过高斯分布来随机选择固定数量的点位怎么改
  • ¥20 nao机器人语音识别问题
  • ¥15 怎么生成确定数目的泊松点过程
  • ¥15 layui数据表格多次重载的数据覆盖问题
  • ¥15 python点云生成mesh精度不够怎么办
  • ¥15 QT C++ 鼠标键盘通信