Silvar Posted January 3, 2013 Share Posted January 3, 2013 This script from the code snippet forum: <?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"); } ?> Doesn't work at all. How come? I've tried several solutions. Quote Link to comment https://forums.phpfreaks.com/topic/272637-google-email-script-doesnt-work/ Share on other sites More sharing options...
Muddy_Funster Posted January 3, 2013 Share Posted January 3, 2013 ... Doesn't work at all. How come? I've tried several solutions. what does "Doesn't work at all" even mean? is it not sending the email? is it erroring out? is it sending a blank message? what solutions have you tried? have you heard of "error checking"? what debugging have you done? If you want people to put the effort in to help you find a solution - you need to put the effort in to properly explain the problem and the steps you have taken so far to try and solve it. Quote Link to comment https://forums.phpfreaks.com/topic/272637-google-email-script-doesnt-work/#findComment-1402979 Share on other sites More sharing options...
Silvar Posted January 3, 2013 Author Share Posted January 3, 2013 (edited) what does "Doesn't work at all" even mean? is it not sending the email? is it erroring out? is it sending a blank message? what solutions have you tried? have you heard of "error checking"? what debugging have you done? If you want people to put the effort in to help you find a solution - you need to put the effort in to properly explain the problem and the steps you have taken so far to try and solve it. Well, there might be many idiots on the internet, but I'm not one of them. People might just use their logical sense. It "Doesn't work at all" like in "It doesn't do anything". I think I explained myself properly. Edited January 3, 2013 by Silvar Quote Link to comment https://forums.phpfreaks.com/topic/272637-google-email-script-doesnt-work/#findComment-1403039 Share on other sites More sharing options...
jazzman1 Posted January 3, 2013 Share Posted January 3, 2013 (edited) @Silvar, is it entire php script to send an email ? Edited January 3, 2013 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/272637-google-email-script-doesnt-work/#findComment-1403051 Share on other sites More sharing options...
Jessica Posted January 3, 2013 Share Posted January 3, 2013 Well, there might be many idiots on the internet, but I'm not one of them. People might just use their logical sense. It "Doesn't work at all" like in "It doesn't do anything". I think I explained myself properly. Now we're all DYING to help you!!! This script is out of date and insecure. Quote Link to comment https://forums.phpfreaks.com/topic/272637-google-email-script-doesnt-work/#findComment-1403052 Share on other sites More sharing options...
Silvar Posted January 3, 2013 Author Share Posted January 3, 2013 Now we're all DYING to help you!!! This script is out of date and insecure. Well, the reply I got containing: "you need to put the effort in to properly explain the problem and the steps you have taken so far to try and solve it." was quite annoying. And I do know how to explain myself right, like a post i saw you made where you told a guy: "I do know how cookies and sessions works, thanks. Enough with the argumentation. I would make the script more secure myself, but first of all, how come it doesn't send the email? I've looked at the URL's from google, and the search query is still at "search=". Quote Link to comment https://forums.phpfreaks.com/topic/272637-google-email-script-doesnt-work/#findComment-1403062 Share on other sites More sharing options...
Silvar Posted January 3, 2013 Author Share Posted January 3, 2013 @Silvar, is it entire php script to send an email ? It's a script to send me an email when someone is sent from google search. The email has to contain the keywords used to find my site. Quote Link to comment https://forums.phpfreaks.com/topic/272637-google-email-script-doesnt-work/#findComment-1403063 Share on other sites More sharing options...
Jessica Posted January 3, 2013 Share Posted January 3, 2013 (edited) Because it's out of date and relying on features that should no longer be used. If you don't realize what's wrong with it, you can't make it more secure. That's not an insult, it's just an assessment. And you DO need to better explain the problem. If people are asking you to explain more, you didn't do enough on your part. You haven't listed any steps you've taken to debug it, or the problem would be obvious. I can see a huge problem just looking at it. Which shows me it's an old script. The quotes around variables that don't need to be strings is also a big giveaway that it's crap. Huge hint: what is $output? Unrelated, but I have absolutely no idea what post of mine you are talking about, but I'm not the one asking for help in this thread, not to mention the quote you've posted has nothing to do with the topic of you not debugging the script at all. Edited January 3, 2013 by Jessica Quote Link to comment https://forums.phpfreaks.com/topic/272637-google-email-script-doesnt-work/#findComment-1403068 Share on other sites More sharing options...
Silvar Posted January 4, 2013 Author Share Posted January 4, 2013 Because it's out of date and relying on features that should no longer be used. If you don't realize what's wrong with it, you can't make it more secure. That's not an insult, it's just an assessment. And you DO need to better explain the problem. If people are asking you to explain more, you didn't do enough on your part. You haven't listed any steps you've taken to debug it, or the problem would be obvious. I can see a huge problem just looking at it. Which shows me it's an old script. The quotes around variables that don't need to be strings is also a big giveaway that it's crap. Huge hint: what is $output? Unrelated, but I have absolutely no idea what post of mine you are talking about, but I'm not the one asking for help in this thread, not to mention the quote you've posted has nothing to do with the topic of you not debugging the script at all. The $output['q'] is the string in the google url that contains the keywords which have been searched for. Quote Link to comment https://forums.phpfreaks.com/topic/272637-google-email-script-doesnt-work/#findComment-1403125 Share on other sites More sharing options...
Jessica Posted January 4, 2013 Share Posted January 4, 2013 Try again. What. Is. $output. Turn on error reporting. Quote Link to comment https://forums.phpfreaks.com/topic/272637-google-email-script-doesnt-work/#findComment-1403136 Share on other sites More sharing options...
Muddy_Funster Posted January 4, 2013 Share Posted January 4, 2013 Well, there might be many idiots on the internet, but I'm not one of them. People might just use their logical sense. It "Doesn't work at all" like in "It doesn't do anything". I think I explained myself properly. Well good for you. I am so pleased the the one person here that we all know can't solve the problem feels that they are clever and providing enough information. You know what, if you don't want help stop asking crap questions and go play on a different forum. If you do want help, stop being a wise ass and work with the people that are trying to help you. I am not going to give someone credit to their inteligence when they are describing a programming issue with the childish simplicity that you did. Untill you can evidence your mantal capacity as being something more, I and many others are going to start at the bottom of what your post suggests you can handle and work up as the responses build - and to be honest, your still at the bottom. Neither Jessica nor myself have a great love of lazyness, bad attitudes or idiots. We all come here in our own time to help others with thier scripts getting no return to oursleves for doing it, we're not going to lie down and take crap from you as well. Quote Link to comment https://forums.phpfreaks.com/topic/272637-google-email-script-doesnt-work/#findComment-1403147 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.