• Hello WordPress masters!

    I have a website that has over 80% of visits from Youtube, and I want, when a visitor comes from another site than Youtube to show him a pop-up window.
    I know the basics of php and html, but i know nothing about sql, and how to to use $get’refer’.
    Is there any plugin that can make this simpler?

    Thank you in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • unn huh
    put this in your header.php file towards the top

    <?php
     //get the refferrer
     $ref = $_SERVER["HTTP_REFERER"];
     //if they are from youtube
     if ( $ref != '*www.youtube*' )
     // echo a popup
     echo 'YOUR POPUP CODE GOES HERE';
     Exit;
     //
     }
     ?>
    Thread Starter kapaionutz

    (@kapaionutz)

    Thank you very much, but i just can`t figure it out how to insert javascript on
    `echo ‘YOUR POPUP CODE GOES HERE’;

    I tried with

    echo {
    <script type=”text/javascript” src=”popup.js”>
    </script>
    }`
    and

    if ( $ref != '*www.youtube*' )
     // echo a popup
    <script type=”text/javascript” src=”popup.js”>
     else
    Exit;
     //
     }
     ?>

    and some other ways, but non of them worked.

    Thank you in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to create a pop-up window for Google visitors?’ is closed to new replies.