For a popup javascript is required. Put this in your header:
<script> function myFunction() { alert("I am an alert box!"); // this is the message in "" } </script>
And this in your body:
<input type="button" onclick="myFunction()" value="Show alert box">
When the button is pressed a box pops up with the message set in the header.
This can be put in any html or php file without the php tags.
—–EDIT—–
To display it using php try this:
<?php echo '<script>myfunction()</script>'; ?>
It may not be 100% correct but the principle is the same.
To display different messages you can either create lots of functions or you can pass a variable in to the function when you call it.
Related Posts:
- PHP – exit or return which is better?
- Where to get php_mcrypt.dll for PHP 7.2?
- When do I use the PHP constant “PHP_EOL”?
- Using $this when not in object context in PHP
- How to use PHP’s password_hash to hash and verify passwords
- PHP password_hash(), password_verify()
- PHP &$string – What does this mean?
- PHP – Failed to open stream : No such file or directory
- Simplest way to profile a PHP script
- Subtract 1 day with PHP
- Warning: session_start(): Cannot send session cookie – headers already sent by (output started at [duplicate]
- Popup window in PHP?
- PHP – Indirect modification of overloaded property
- Why is the response on localhost so slow?
- ssh : Permission denied (publickey,gssapi-with-mic)
- How do I correctly clean up a Python object?
- mysqli_real_connect(): (HY000/2002): No such file or directory
- Change PHP version on server using either .htaccess or php.ini
- Android java.lang.IllegalStateException: Could not execute method of the activity
- How to find the last day of the month from date?
- php_network_getaddresses: getaddrinfo failed: Name or service not known (0) Failed To Connect..!
- Formatting a number with leading zeros in PHP
- Why isn’t WordPress part of Framework Interop Group?
- Dynamically add id to heading tags
- JqueryUi Dialog giving Uncaught TypeError: this._addClass is not a function error
- Adding a text domain to every __(), _e() and __n() gettext call without a plan to create own translations
- How to place login logout link on menu that redirects users back to current page?
- How to protect own PHP code from WordPress updates
- Woocommerce price including tax with formatting from options
- get_template_part not working with ajax
- Adding a post shortcode to a page template?
- How does WooCommerce ensure that a product doesn’t run out of stock during payment? [closed]
- Can I change a variable in a content part while calling it?
- send_headers don’t work on wordpress multisite
- How do you target virtual pages in code?
- Placing the_content inside shortcode not working
- How to fetch an array in $wpdb?
- Maintenance holding page while migrating website
- How can I add an alert (like the old javascript alerts) to my WP page?
- Change behavior of the tag
- Is it acceptable to treat a filter like an action?
- Fetch post block/field data as JSON with WordPress API
- How to design a table based on css values set from admin/dashboard
- Get the post ID and display the images
- External RSS feed to WordPress Portfolio
- wp_head function not outputting
- How to manually change current date to post date in frontend?
- Why does wp_head hook my functions to the beginning of my source code?
- Noscript not working as it should in wordpress site
- Pass argument to event hook
- Translate wordpress date from Italian to English
- wp_insert_post: array only. wp_update_post: array|object (?)
- If ‘editor’ is empty, then
- Different Subdomain changes page content
- Removing the comment function within wordpress
- Get ACF options field in PHP acting as CSS
- Permalinks are not working in WordPress in digitalocean
- Undefined $post in wp_query
- Bootstrap Carousel HTML structure and funny output [closed]
- How to remove custom style from source?
- Missing a text-domain esc_attr_e
- Get all posts from categories
- How to add post classes?
- Extract and display user infromation on an automatically created page
- Why won’t this wpdb get_results query return results?
- How can I assign separate stylesheets to different pages?
- Using multiple variables to assign categories to an array
- Adding a Tag Parameter / Filter to My Shortcode
- Show Custom Menu Name in WordPress 3
- Repeat a function with 24hrs gap for n number of days
- Add a custom WooCommerce settings tab with sections
- Ajax call not working in wordpress through a plugin
- How to call my PHP function with AJAX ? wp_query
- Cookie value changes back to previous value after changing
- No more get_option(‘date_time’) in WordPress 5.5?
- Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?
- How to update post content of all posts with tag?
- Create category after theme setup and modify the default one
- How to Change Site Elements based on referring URL
- WP post meta – for loop inside for loop
- Update (a function) post’s featured image as soon as $image_url changes
- Prepared DB Query from _POST array
- auto metakey value on post tile
- Static home page ignored
- How do I routinely extract the thumbnail of the most recent post?
- How to order users alphabetically by name? in plugin UPME
- How to pass parameter that ends up being part of a class name with wordpress shortcode
- Get month and day from a Date Picker custom field
- calling a function from a class in your template
- WordPress Background Audio – Continous AutoPlay
- Custom single.php files for different post formats
- How use Dynamic hyperlink on each wordpress post?
- If I define a variable in header.php, how do I make it available to templates?
- Order woo products, but first products must be with acf fields
- Remove /category/ from category (archive) page URLs (without using a plugin)
- How to execute init or woocommerce_init only for checkout page
- JSON Object Value Show Undefine
- wordpress jquery is not defined because the head tag is empty
- Software vs hardware RAID performance and cache usage
- How do high traffic sites service more than 65535 TCP connections?