<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=us-ascii" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello again,<br>
<br>
Thanks for all your suggestions.<br>
<br>
I have done some tests using a snippet of code from the PHP online
manual page for $_SERVER, provided by corrodedmonkee at gmail dot com
at 22-Sep-2009 04:16.<br>
<br>
"Just an improved version of jeffwks table of $_SERVER variables, and
will pick up future additions without modification."<br>
<br>
<tt><?php<br>
echo '<table border="1">';<br>
<br>
foreach($_SERVER as $k => $v) {<br>
echo
'<tr><td>'.$k.'</td><td>'.$v.'</td></tr>';<br>
}<br>
echo '</table>';<br>
?> <br>
<br>
</tt>I found the following variables contained the sort of information
I am looking for:<br>
SCRIPT_URL<br>
SCRIPT_URI<br>
HTTP_HOST<br>
SERVER_NAME<br>
SCRIPT_FILENAME<br>
REQUEST_URI<br>
SCRIPT_NAME<br>
PHP_SELF<br>
<br>
The first two don't appear when the host is localhost and the last
three have contained the same string in each of my tests. Also in my
tests HTTP_HOST and SERVER_NAME contained the same string. SCRIPT_URI
looks to contain the information I need to build my bookmarks.<br>
<br>
Interestingly HTTP_REFERER doesn't appear in the list and the PHP
manual says "... <span class="simpara">In short, it cannot really be
trusted." So it looks as if the other variables may be safer to use.<br>
<br>
Thanks again for your suggestions and best wishes,<br>
<br>
Peter Crouch<br>
-------------------------------------------------<br>
Tel: 0121 523 6756<br>
Mobile: 0776 877 0475<br>
Email: <a class="moz-txt-link-abbreviated" href="mailto:pccrouch@bcs.org.uk">pccrouch@bcs.org.uk</a><br>
<br>
**********************************************************************<br>
This email and any files transmitted with it are confidential and<br>
intended solely for the use of the individual or entity to whom they<br>
are addressed. If you have received this email in error please notify<br>
the system manager.<br>
**********************************************************************<br>
<br>
</span><br>
<br>
Stephen Orr wrote:
<blockquote
cite="mid:5b1450760910270833x657a0eddme2d0f5119140a297@mail.gmail.com"
type="cite">
<pre wrap="">And also, some antivirus software (Norton and McAfee used to do this)
strip the referrer header as a way to protect their users. Nice theory
I suppose.
Steve
2009/10/27 Tom Graham <a class="moz-txt-link-rfc2396E" href="mailto:me@noginn.com"><me@noginn.com></a>:
</pre>
<blockquote type="cite">
<pre wrap="">Also remember that the HTTP_REFERER index may not always be set as not all
requests will contain the Referrer header.
Tom
2009/10/27 Simon Ferre <a class="moz-txt-link-rfc2396E" href="mailto:simon.ferre@onetwodo.co.uk"><simon.ferre@onetwodo.co.uk></a>
</pre>
<blockquote type="cite">
<pre wrap="">Hi
I believe what you are looking for is not a function, but a PHP variable:
_SERVER["HTTP_REFERER"]
Gives you the page that referred you to the current page.
Do a phpinfo(); to find out more...
Simon
-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:phpwm-bounces@mailman.lug.org.uk">phpwm-bounces@mailman.lug.org.uk</a>
[<a class="moz-txt-link-freetext" href="mailto:phpwm-bounces@mailman.lug.org.uk">mailto:phpwm-bounces@mailman.lug.org.uk</a>] On Behalf Of Peter Crouch
Sent: 27 October 2009 10:39
To: West Midlands PHP User Group
Subject: [Phpwm] Simple? question
Hello to you all,
I have spent some time looking through the online PHP reference manual
searching for a function which will return the URL or URI of the web
page from which it is invoked, without success.
I want to write a PHP script which will construct bookmarks for the
likes of Facebook and Twitter for any web page from which it is called.
I suspect I am trying to reinvent the wheel!
I am sure that some of you experts will be able to point me in the right
direction very quickly!
Thanks in advance for any help you can give me.
Peter Crouch
-------------------------------------------------
Tel: 0121 523 6756
Mobile: 0776 877 0475
Email: <a class="moz-txt-link-abbreviated" href="mailto:pccrouch@bcs.org.uk">pccrouch@bcs.org.uk</a>
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
_______________________________________________
Phpwm mailing list
Website : <a class="moz-txt-link-freetext" href="http://www.phpwm.org">http://www.phpwm.org</a>
Twitter : <a class="moz-txt-link-freetext" href="http://www.twitter.com/phpwm">http://www.twitter.com/phpwm</a>
Facebook: <a class="moz-txt-link-freetext" href="http://www.facebook.com/group.php?gid=2361609907">http://www.facebook.com/group.php?gid=2361609907</a>
Post to list: <a class="moz-txt-link-abbreviated" href="mailto:Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a>
Archive etc : <a class="moz-txt-link-freetext" href="https://mailman.lug.org.uk/mailman/listinfo/phpwm">https://mailman.lug.org.uk/mailman/listinfo/phpwm</a>
_______________________________________________
Phpwm mailing list
Website : <a class="moz-txt-link-freetext" href="http://www.phpwm.org">http://www.phpwm.org</a>
Twitter : <a class="moz-txt-link-freetext" href="http://www.twitter.com/phpwm">http://www.twitter.com/phpwm</a>
Facebook: <a class="moz-txt-link-freetext" href="http://www.facebook.com/group.php?gid=2361609907">http://www.facebook.com/group.php?gid=2361609907</a>
Post to list: <a class="moz-txt-link-abbreviated" href="mailto:Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a>
Archive etc : <a class="moz-txt-link-freetext" href="https://mailman.lug.org.uk/mailman/listinfo/phpwm">https://mailman.lug.org.uk/mailman/listinfo/phpwm</a>
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
Phpwm mailing list
Website : <a class="moz-txt-link-freetext" href="http://www.phpwm.org">http://www.phpwm.org</a>
Twitter : <a class="moz-txt-link-freetext" href="http://www.twitter.com/phpwm">http://www.twitter.com/phpwm</a>
Facebook: <a class="moz-txt-link-freetext" href="http://www.facebook.com/group.php?gid=2361609907">http://www.facebook.com/group.php?gid=2361609907</a>
Post to list: <a class="moz-txt-link-abbreviated" href="mailto:Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a>
Archive etc : <a class="moz-txt-link-freetext" href="https://mailman.lug.org.uk/mailman/listinfo/phpwm">https://mailman.lug.org.uk/mailman/listinfo/phpwm</a>
</pre>
</blockquote>
<pre wrap=""><!---->
_______________________________________________
Phpwm mailing list
Website : <a class="moz-txt-link-freetext" href="http://www.phpwm.org">http://www.phpwm.org</a>
Twitter : <a class="moz-txt-link-freetext" href="http://www.twitter.com/phpwm">http://www.twitter.com/phpwm</a>
Facebook: <a class="moz-txt-link-freetext" href="http://www.facebook.com/group.php?gid=2361609907">http://www.facebook.com/group.php?gid=2361609907</a>
Post to list: <a class="moz-txt-link-abbreviated" href="mailto:Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a>
Archive etc : <a class="moz-txt-link-freetext" href="https://mailman.lug.org.uk/mailman/listinfo/phpwm">https://mailman.lug.org.uk/mailman/listinfo/phpwm</a>
</pre>
</blockquote>
</body>
</html>