Title: php &quot;close&quot; javascript
Last modified: August 20, 2016

---

# php "close" javascript

 *  [hitman72](https://wordpress.org/support/users/hitman72/)
 * (@hitman72)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/php-close-javascript/)
 * hi, I am a wordpress, html and php newbie 🙂 In “functions.php” I have added 
   these lines to show a “thank you” autoclose popup after someone leave a comment.
 * add_filter(‘comment_post_redirect’, ‘redirect_after_comment’);
    function redirect_after_comment(
   $location) { print(“<script type=’text/javascript’ src=’POPUP/GRAZIE/Grazie_adplib.
   js’></script>”); print(“<script type=’text/javascript’ src=’POPUP/GRAZIE/Grazie.
   js’></script>”); }
 * these 2 lines of javascript show a popup of thanks after someone leave a post
   and work well. but If I add a php line to go to top of page after javascript,
   the popup it is no longer shown, seems (from newbie) that php has priority over
   javscript.
 * function redirect_after_comment($location)
    { print(“<script type=’text/javascript’
   src=’POPUP/GRAZIE/Grazie_adplib.js’></script>”); print(“<script type=’text/javascript’
   src=’POPUP/GRAZIE/Grazie.js’></script>”); **return $_SERVER[“HTTP_REFERER”];**}
 * The page with this code simply goes on top without showing any pop-up.
    otherwise,
   how can I insert a simple popup with jquery instead of javascript? thank you 
   ad sorry for my poor english, ciao

The topic ‘php "close" javascript’ is closed to new replies.

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [popup](https://wordpress.org/support/topic-tag/popup/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [hitman72](https://wordpress.org/support/users/hitman72/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/php-close-javascript/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
