Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 当我留言结束后,点击一个alert返回前一页

当我留言结束后,点击一个alert返回前一页

Jun 23, 2016 pm 01:52 PM
alert Click message Finish

$data['univ_name']=$id;
$data['user_name']=$user_name;
$data['user_comment']=$_POST['user_comment'];
$data['user_comment_good']=$score;
$data['user_comment_money']=$_POST['user_comment_money'];
$data['user_comment_date']=$_POST['user_comment_date'];
$User->add($data);
$result = $User->select ();
$this->success("留言成功");
}
$this->user_state = $user_state;
$this->display();
这是一段留言代码,当我成功时候 $this->success("留言成功"); 它会跳出来一个页面,这个页面不好看,
现在我想跳出一个alert 或者跳转页面也行,但是当我点击alert的确定按钮时候我希望它能够返回到我写留言的那页
准确说就是我想获取success的URL 让我的alert也能实现回去前一页的效果  请问要怎么做好? 最好有个代码什么的 如果大家说的我不明白 我还能研究一下代码。。


回复讨论(解决方案)

获取refer就可以了。 代码没有

我记得JS可以直接返回上一级的URL的go.history(-1)我记得是这个。

$this->success("留言成功");
改?

echo '<script type="text/javascript">'."\r\n";echo 'alert("留言成功");'."\r\n";echo 'window.history.go(-1);'."\r\n";echo '</script>';
Copy after login

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to set multiple timers on iPhone iOS 17 How to set multiple timers on iPhone iOS 17 Sep 18, 2023 am 09:01 AM

In iOS 17, you can set multiple timers on your iPhone using the Clock app, or use Siri to set it hands-free. We discuss both in this article. Let's take a look at them. Set Multiple Timers on iPhone Using the Clock App Open the Clock app on your iPhone and tap the Timers tab in the lower right corner. Now, set the hours, minutes, and seconds. You can use the "Label" and "When does the timer end" options to set a name for the timer and a preferred tone when the timer completes. This will help you differentiate between timers. Once done, click the "Start" button. Then, click the "+" icon in the upper right corner. Now, repeat the above steps to set multiple timers on iPhone. You can also browse

How to Make a Shopping List in the iOS 17 Reminders App on iPhone How to Make a Shopping List in the iOS 17 Reminders App on iPhone Sep 21, 2023 pm 06:41 PM

How to Make a GroceryList on iPhone in iOS17 Creating a GroceryList in the Reminders app is very simple. You just add a list and populate it with your items. The app automatically sorts your items into categories, and you can even work with your partner or flat partner to make a list of what you need to buy from the store. Here are the full steps to do this: Step 1: Turn on iCloud Reminders As strange as it sounds, Apple says you need to enable reminders from iCloud to create a GroceryList on iOS17. Here are the steps for it: Go to the Settings app on your iPhone and tap [your name]. Next, select i

How to set up my business card in Contacts on iPhone [2023] How to set up my business card in Contacts on iPhone [2023] Sep 22, 2023 pm 09:17 PM

With My Business Cards in iOS, you can create a personalized contact card that Siri and other services recognize and associate with you and your phone number. With the introduction of contact posters in iOS17, My Cards becomes very important as it is now used to create your contact posters. If you're eager to get your contact poster up and running, you have to start by setting up My Business Card. We'll walk through how to create a My Business Card and how to make it work smoothly with Siri and your contact poster. How to Set Up My Business Cards in Contacts on iPhone [2023] If you are setting up My Business Cards on your iPhone for the first time, you must do it through the Contacts app only

When will Teamfight Tactics S11 end? When will Teamfight Tactics S11 end? Mar 18, 2024 pm 03:16 PM

Each season of Teamfight Tactics lasts about three months. Currently, the US test server of Teamfight Tactics S11 season will be updated and launched on March 7. Teamfight Tactics and Golden Shovel will be updated and launched on March 21. It is speculated that the S11 season It will probably end in early July. When will TFT S11 end? Answer: Early July. 1. It is speculated that the S11 season will end in early July. The specific end date needs to wait for the official announcement. 2. Each season of Teamfight Tactics lasts about three months. 3. The US test server of Teamfight Tactics S11 season will be updated and launched on March 7, and Teamfight Tactics and Golden Shovel will be updated and launched on March 21. 4. A new gameplay mechanism will be added to the S11 season, and more than 20 new Ornn artifacts will be added.

How to implement line break in alert How to implement line break in alert Nov 07, 2023 am 10:19 AM

alert implements line breaks using the br tag.

How to leave a message on Xianyu How to leave a message on Xianyu and chat privately How to leave a message on Xianyu How to leave a message on Xianyu and chat privately Mar 23, 2024 am 09:10 AM

Xianyu APP is a super second-hand trading software. It allows everyone to choose products here at will, or publish their own products for sale. There is no problem. Everything can be realized here. When you use it here When using the Xianyu APP, everyone needs to communicate in a timely manner by leaving messages to get more information and help you sell or buy goods better. It is relatively convenient and is aimed at those who still don’t know how to leave messages on Xianyu. For my friends, I have now brought you specific Xianyu message tutorials. I hope it will be helpful to you. Xianyu message tutorial: 1. First, open Xianyu. 2. Then enter the interface and click on a product. 3. Then in the interface that appears, slide up and click

How to change contact photos on iPhone How to change contact photos on iPhone Jun 08, 2023 pm 03:44 PM

iOS17 is finally here, and it includes a lot of new features. Let's learn how to change contact photos on iPhone in today's tutorial. Apple's recent WWDC 2023 event unveiled a slew of exciting products and upcoming software updates. One of the notable features of iOS 17 is the option to customize your contact photos and posters, providing a unique way to greet others when they receive a call from you on their iPhone. This innovative feature for iOS is designed to make phone calls more personal and user-friendly, allowing you to choose how they appear on the recipient's screen. If you're eager to get your hands on this new feature and greet your loved ones in a personalized way when making calls, here's how to add it to your iPhone

How to quickly turn off the shortcut keys running in the background of Win11? How to quickly turn off the shortcut keys running in the background of Win11? Dec 28, 2023 am 09:54 AM

When we use computers, we will inevitably encounter a lot of problems that keep running in the background, which slows down the system. At this time, is there a shortcut key to end the background running in win11? In fact, we can only open the task manager with the shortcut key and then close it. Backstage. Shortcut keys to end background running in win11: 1. First, we press the "ctrl+shift+esc" shortcut key combination on the keyboard to open the task manager page. 2. In the Task Manager page, use the mouse to click and select the "Name" button option. 3. After the page jumps, we can directly see all the "background processes" currently running. 4. According to actual needs, we select the background that we want to close, and click "End Task" in the lower right corner of the option.

See all articles