![]() |
Automatic mail on PHP web page?
Is there anyway I can be emailed automatically when someone accesses a certain web page scripted in PHP? I don't know much PHP so I am looking really for someone to find my a code which does this?
|
Re: Automatic mail on PHP web page?
should be fairly easy to send an email as soon as someone accesses a php page. You would need to write a session cookie to store a value to avoid getting multiple emails eg if a user refreshes/submits the page this would coarse the page to send another email which you may not want
Does your web pages use any authentication? Could I ask what you need this for? Do you have a it connected to a database such as mysql? If so you could record it there rather than emails. |
Re: Automatic mail on PHP web page?
Do you need the email to say WHO visited the page?
Or just that someone has? |
Re: Automatic mail on PHP web page?
Quote:
Can anyone help? |
Re: Automatic mail on PHP web page?
Yeah, I'm sure I can find one for you, I'll send it over in a few minutes, when I find it
EDIT: PHP Code:
Obviously if you fill it all in first. ;) |
Re: Automatic mail on PHP web page?
This is a simple php mail() function script
Code:
<?php |
Re: Automatic mail on PHP web page?
It depends what kind of Page it is, if its one, where the same visitor would visit it multiple times, then you would be getting quite a few emails from the same user.
But if the user would only visit this page once, one of these 2 scripts would be fine |
Re: Automatic mail on PHP web page?
Quote:
Thanks. I have used this one as it gives the option of a 'from' address. Thanks for all your help though. Jack :-) |
Re: Automatic mail on PHP web page?
The previous script is actually better as it checks to see if the email was sent sucessfully rather than just assuming it was, you could easily merge the 2 :)
|
Re: Automatic mail on PHP web page?
Something like this should suit your needs, It has the From Function & checks to see if it sends or not. ;)
PHP Code:
|
Re: Automatic mail on PHP web page?
Yeah sorry I couldve done that been busy lol
|
Re: Automatic mail on PHP web page?
Haha, Thought I'd be helpful ;)
|
| All times are GMT. The time now is 06:47. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum