yshua Posted January 12, 2011 Share Posted January 12, 2011 Right now, the following PHP script claims to send an email for Google referrals, as your forum states. I put it in the first few lines of index.php. Is this wrong, because I still received zero emails, adding the site name to keywords below...? And, of course, I searched the same keyword from Google without success. <?php // Script to email you when Google refers traffic to your site. $name=""; // add your name here $email_address=""; // add your email address here $keywords=""; $referrer=$_SERVER['HTTP_REFERER']; if( (stristr($referrer, "google")) && (stristr($referrer, "search")) ) { parse_str($referrer, $output); $keywords=$output['q']; $email_message="Hi $name, A visitor just arrived to your site after searching for '$keywords'. ($referrer)"; mail ("$email_address","Google referred a visitor","$email_message"); } ?> If this is wrong, how DO I use such a PHP within my phpmyadmin folder? Need help. Quote Link to comment Share on other sites More sharing options...
requinix Posted January 12, 2011 Share Posted January 12, 2011 Did you also change the $email_address? Have you checked your junk/spam folder? And what does this have to do with phpMyAdmin? Quote Link to comment Share on other sites More sharing options...
yshua Posted January 12, 2011 Author Share Posted January 12, 2011 Correct. I am new to this, and my email address and name were filled in between the quotes. And thanks to you asking, the Spam folder was empty as well. In regards to the reference to phpmyadmin, this is something new to me. The index.php file (I was used to index.html) I believe is referenced through my contracted one time software provider under that folder. Now I truly am unfamiliar with the PHP programming heirarchy of index.php, database, config files, etc. I am just getting my feet wet and would appreciate any and all pointers.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.