Jump to content

Google Email script doesn't work


Silvar

Recommended Posts

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.

Link to comment
Share on other sites

...

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.

Link to comment
Share on other sites

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 by Silvar
Link to comment
Share on other sites

 

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. 

Link to comment
Share on other sites

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=".

Link to comment
Share on other sites

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 by Jessica
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.