<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Reflection Media &#187; alert</title>
	<atom:link href="http://www.reflectionmedia.ro/tag/alert/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reflectionmedia.ro</link>
	<description>Custom WordPress Solutions</description>
	<lastBuildDate>Tue, 24 Jan 2012 10:34:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>404 email alert</title>
		<link>http://www.reflectionmedia.ro/2009/05/29/404-email-alert404-email-alert/</link>
		<comments>http://www.reflectionmedia.ro/2009/05/29/404-email-alert404-email-alert/#comments</comments>
		<pubDate>Fri, 29 May 2009 09:44:26 +0000</pubDate>
		<dc:creator>Cristian</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://www.reflectionmedia.ro/2009/05/404-email-alert404-email-alert/</guid>
		<description><![CDATA[Here is a little PHP code snippet to add to your 404 page, in order to get an email alert with all sorts of useful data, each time a 404 page is accessed. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a little PHP code snippet to add to your 404 page, in order to get an email alert with all sorts of useful data, each time a 404 page is accessed.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_REFERER'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$ref</span><span style="color: #339933;">=</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_REFERER'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$ref</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'none'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$sitename</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Reflection Media'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$recipient</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'mail@gmail.com'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'New '</span><span style="color: #339933;">.</span><span style="color: #000088;">$sitename</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' 404 accessed'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mail_body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'
A new 404 page has been accessed:
&nbsp;
The accessed URI was: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'
The user'</span>s IP address<span style="color: #339933;">:</span> <span style="color: #0000ff;">'.$_SERVER['</span>REMOTE_ADDR<span style="color: #0000ff;">'].'</span>
The user<span style="color: #0000ff;">'s Internet browser: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'
The URI from where your user came: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$ref</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'
'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$header</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'From: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$sitename</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' 404 page &lt;no-reply@mail.com&gt;rn'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$recipient</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mail_body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$header</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.reflectionmedia.ro/2009/05/29/404-email-alert404-email-alert/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

