PHP pop-up dialog box skills

Source: Internet
Author: User
Tags php print
After implementing the PHP pop-up dialog box, we usually need to return the original page or replace the original page with a new page. This article will explain the detailed code writing, for more information, see how many programmers use PHP for WEB development. In this case, functions such as Dialog box pop-up are usually required on the website. The following describes the implementation methods of the PHP pop-up dialog box.
1. PHP pop-up dialog box

<? PHP echo "<script language = \" JavaScript \ "> alert (\" \ "); </script>" ;?> // Or <? PHP print "<script language = \" JavaScript \ "> alert (\" hello \ "); </script>" ;?>

2. if you need a PHP pop-up dialog box and then return to the original page, you can write it like this.

<? PHP echo "<script language = \" JavaScript \ "> \ r \ n"; echo "alert (\" hello \ "); \ r \ n"; echo "history. back (); \ r \ n "; echo" </script> "; exit;?> // Or <? PHP print "<script language = \" JavaScript \ "> \ r \ n"; print "alert (\" hello \ "); \ r \ n"; print "history. back (); \ r \ n "; print" </script> "; exit;?>

3. if the PHP pop-up dialog box is required, replace the original page with a new page (replace the current history). The original page can be written in this way.

<? PHP echo "<script language = \" JavaScript \ "> \ r \ n"; echo "alert (\" hello \ "); \ r \ n"; echo "location. replace (\ "http://www.jb51.net/\"); \ r \ n "; // modify your own URL echo" </script> "; exit;?> Or <? PHP print "<script language = \" JavaScript \ "> \ r \ n"; print "alert (\" hello \ "); \ r \ n"; print "location. replace (\ "http://www.jb51.net/\"); \ r \ n "; // modify your own URL print" </script> "; exit;?>

This article introduces three conditions of the PHP pop-up dialog box, hoping to help you master the implementation of the PHP pop-up dialog box.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.