在将用户重定向到另一个网页后显示消息 [英] displaying a message after redirecting the user to another web page

查看:101
本文介绍了在将用户重定向到另一个网页后显示消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用PHP和MySql做HTML。
在用户执行了一些数据库操作之后,我的系统将用户重定向到原始数据库页面,以便向他显示更新的表格。 (我完成了这部分)。
同时,我希望在原始页面(系统移动的那个页面)上向用户显示一条消息,以通知操作成功。如何显示此消息?



这是我的php代码移至其他页面。

 标题('Location:Database.php'); 


解决方案

 标题'Location:Database.php?success = 1'); 

并且在Database.php页面中:

  if(isset($ _ GET ['success'])&& $ _GET ['success'] == 1)
{
// treat例如:
回应成功;
}


I am doing HTML with PHP and MySql. After some database operation that was performed by the user, my system redirects the user to the original database page in order to show him the updated table. (I am done with this part). At the same time, I wish to display a message to the user on the original page (the one where the system moved) to notify him with the success of the operation. How can I possibly display this message?

Here's my php code that moves to the other page.

Header( 'Location: Database.php');

解决方案

Header( 'Location: Database.php?success=1' );

And in the Database.php page :

if ( isset($_GET['success']) && $_GET['success'] == 1 )
{
     // treat the succes case ex:
     echo "Success";
}

这篇关于在将用户重定向到另一个网页后显示消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆