php-windows Digest 24 Feb 2012 14:48:14 -0000 Issue 4008
Topics (messages 30782 through 30788):
Re: Trying to retrieve/confirm referrer URL in a PHP page/script
30782 by: Lester Caine
30783 by: Jacob Kruger
30784 by: Warren Vail
30785 by: Jacob Kruger
30786 by: Jacob Kruger
30787 by: Jacob Kruger
PHP mysqli support
30788 by: Jacob Kruger
Administrivia:
To subscribe to the digest, e-mail:
php-windows-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-windows-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-wind...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Jacob Kruger wrote:
As subject line says, it would be nice, sometimes, specifically in terms of
form submission processing to maybe confirm the referring URL/server, and I
have used similar things in past with classic ASP etc., but can't remember that
exact syntax, but think it had something to do with something like a HTTP
response referer header or something.
Either way, I know there are collections of values like $_REQUEST, $_SERVER,
etc., but not sure where to try find something like this, or if it's
simply/easily possible/doable?
http://php.net/manual/en/reserved.variables.server.php
'REQUEST_URI'
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
--- End Message ---
--- Begin Message ---
Ok, had a look at the phpinfo() output, but not sure what to look for, since
doesn't seem to reflect any form of referer info, etc., unless it's related
to one of the $_SERVER array elements/items?
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "George Pitcher" <george.pitc...@publishingtechnology.com>
To: "Jacob Kruger" <jac...@mailzone.co.za>
Sent: Wednesday, February 22, 2012 9:44 AM
Subject: RE: [PHP-WIN] Trying to retrieve/confirm referrer URL in a PHP
page/script
Jacob,
Have a look at the phpinfo() output. That should point you to the correct
method for your site.
George
-----Original Message-----
From: Jacob Kruger [mailto:jac...@mailzone.co.za]
Sent: 22 February 2012 07:31
To: php-wind...@lists.php.net
Subject: [PHP-WIN] Trying to retrieve/confirm referrer URL in a PHP
page/script
As subject line says, it would be nice, sometimes, specifically in terms of
form submission processing to maybe confirm the referring URL/server, and I
have used similar things in past with classic ASP etc., but can't remember
that exact syntax, but think it had something to do with something like a
HTTP response referer header or something.
Either way, I know there are collections of values like $_REQUEST, $_SERVER,
etc., but not sure where to try find something like this, or if it's
simply/easily possible/doable?
TIA
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
The information in this message is intended solely for the addressee and
should be considered confidential. Publishing Technology does not accept
legal responsibility for the contents of this message and any statements
contained herein which do not relate to the official business of Publishing
Technology are neither given nor endorsed by Publishing Technology and are
those of the individual and not of Publishing Technology. This message has
been scanned for viruses using the most current and reliable tools available
and Publishing Technology excludes all liability related to any viruses that
might exist in any attachment or which may have been acquired in transit.
--- End Message ---
--- Begin Message ---
http://us.php.net/manual/en/reserved.variables.server.php cited is a good
resource, you might have better luck with
$_SERVER['HTTP_REFERER']
You might want to first check the user agent (browser) with get_browser()
to determine if it is one of those that can spoof the answer. Bottom line
it's not always trustworthy, some clients can, under certain circumstances,
fake being referred from one of your own pages.
Warren Vail
Vail Systems Technology
war...@vailtech.net
(510) 444-5380
-----Original Message-----
From: Lester Caine [mailto:les...@lsces.co.uk]
Sent: Tuesday, February 21, 2012 11:53 PM
To: php-windows
Subject: Re: [PHP-WIN] Trying to retrieve/confirm referrer URL in a PHP
page/script
Jacob Kruger wrote:
> As subject line says, it would be nice, sometimes, specifically in terms
of form submission processing to maybe confirm the referring URL/server, and
I have used similar things in past with classic ASP etc., but can't remember
that exact syntax, but think it had something to do with something like a
HTTP response referer header or something.
>
> Either way, I know there are collections of values like $_REQUEST,
$_SERVER, etc., but not sure where to try find something like this, or if
it's simply/easily possible/doable?
http://php.net/manual/en/reserved.variables.server.php
'REQUEST_URI'
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Ok, will check out REQUEST_URI as well, but, after setting up a remote page
to then go to the local page, I figured out that this one seems to retrieve
it as well:
$_SERVER["HTTP_REFERER"]
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Lester Caine" <les...@lsces.co.uk>
To: "php-windows" <php-wind...@lists.php.net>
Sent: Wednesday, February 22, 2012 9:52 AM
Subject: Re: [PHP-WIN] Trying to retrieve/confirm referrer URL in a PHP
page/script
Jacob Kruger wrote:
As subject line says, it would be nice, sometimes, specifically in terms
of form submission processing to maybe confirm the referring URL/server,
and I have used similar things in past with classic ASP etc., but can't
remember that exact syntax, but think it had something to do with
something like a HTTP response referer header or something.
Either way, I know there are collections of values like $_REQUEST,
$_SERVER, etc., but not sure where to try find something like this, or if
it's simply/easily possible/doable?
http://php.net/manual/en/reserved.variables.server.php
'REQUEST_URI'
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I know it can be faked, and while not 100% relevant, what have done in past
to sort of hide things like javascript source is also to set a $_SESSION
value in the page that then calls the javascript source inclusion using
something like:
<script type="text/javascript" src="jsSource.php"></script>
And then in jsSource.php I would actually check the $_SESSION variable
value, before rendering the script source as such, and then unsetting it,
and this meant that while someone could look at the source of the parent
page, they couldn't actually have a look at the actual javascript source as
such, but anyway...<smile>
So, I suppose, if you wanted to make a bit more sure, you could do something
like check the value of a $_SESSION value at the top of each page, then turn
it off while performing whatever operations, and then turn it on again at
end of page, or something - LOL!
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Warren Vail" <war...@vailtech.net>
To: "'Lester Caine'" <les...@lsces.co.uk>; "'php-windows'"
<php-wind...@lists.php.net>
Sent: Wednesday, February 22, 2012 10:08 AM
Subject: RE: [PHP-WIN] Trying to retrieve/confirm referrer URL in a PHP
page/script
http://us.php.net/manual/en/reserved.variables.server.php cited is a good
resource, you might have better luck with
$_SERVER['HTTP_REFERER']
You might want to first check the user agent (browser) with get_browser()
to determine if it is one of those that can spoof the answer. Bottom line
it's not always trustworthy, some clients can, under certain
circumstances,
fake being referred from one of your own pages.
Warren Vail
Vail Systems Technology
war...@vailtech.net
(510) 444-5380
-----Original Message-----
From: Lester Caine [mailto:les...@lsces.co.uk]
Sent: Tuesday, February 21, 2012 11:53 PM
To: php-windows
Subject: Re: [PHP-WIN] Trying to retrieve/confirm referrer URL in a PHP
page/script
Jacob Kruger wrote:
As subject line says, it would be nice, sometimes, specifically in terms
of form submission processing to maybe confirm the referring URL/server,
and
I have used similar things in past with classic ASP etc., but can't
remember
that exact syntax, but think it had something to do with something like a
HTTP response referer header or something.
Either way, I know there are collections of values like $_REQUEST,
$_SERVER, etc., but not sure where to try find something like this, or if
it's simply/easily possible/doable?
http://php.net/manual/en/reserved.variables.server.php
'REQUEST_URI'
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
It seemed to not get set when just typing in the address of the page
rendering phpinfo(), which makes sense, so I suppose you could use isset to
make sure the request had come from somewhere, and then check the
$_SERVER["HTTP_REFERER"] value to make sure it was from your site, or
wherever.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "George Pitcher" <george.pitc...@publishingtechnology.com>
To: "Jacob Kruger" <jac...@mailzone.co.za>
Sent: Wednesday, February 22, 2012 10:07 AM
Subject: RE: [PHP-WIN] Trying to retrieve/confirm referrer URL in a PHP
page/script
Jacob,
It's almost certainly going to be one of the $_SERVER elements, but you can
check which one by looking down the properties.
George
-----Original Message-----
From: Jacob Kruger [mailto:jac...@mailzone.co.za]
Sent: 22 February 2012 08:03
To: php-wind...@lists.php.net
Subject: Re: [PHP-WIN] Trying to retrieve/confirm referrer URL in a PHP
page/script
Ok, had a look at the phpinfo() output, but not sure what to look for, since
doesn't seem to reflect any form of referer info, etc., unless it's related
to one of the $_SERVER array elements/items?
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "George Pitcher" <george.pitc...@publishingtechnology.com>
To: "Jacob Kruger" <jac...@mailzone.co.za>
Sent: Wednesday, February 22, 2012 9:44 AM
Subject: RE: [PHP-WIN] Trying to retrieve/confirm referrer URL in a PHP
page/script
Jacob,
Have a look at the phpinfo() output. That should point you to the correct
method for your site.
George
-----Original Message-----
From: Jacob Kruger [mailto:jac...@mailzone.co.za]
Sent: 22 February 2012 07:31
To: php-wind...@lists.php.net
Subject: [PHP-WIN] Trying to retrieve/confirm referrer URL in a PHP
page/script
As subject line says, it would be nice, sometimes, specifically in terms of
form submission processing to maybe confirm the referring URL/server, and I
have used similar things in past with classic ASP etc., but can't remember
that exact syntax, but think it had something to do with something like a
HTTP response referer header or something.
Either way, I know there are collections of values like $_REQUEST, $_SERVER,
etc., but not sure where to try find something like this, or if it's
simply/easily possible/doable?
TIA
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
The information in this message is intended solely for the addressee and
should be considered confidential. Publishing Technology does not accept
legal responsibility for the contents of this message and any statements
contained herein which do not relate to the official business of Publishing
Technology are neither given nor endorsed by Publishing Technology and are
those of the individual and not of Publishing Technology. This message has
been scanned for viruses using the most current and reliable tools available
and Publishing Technology excludes all liability related to any viruses that
might exist in any attachment or which may have been acquired in transit.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
The information in this message is intended solely for the addressee and
should be considered confidential. Publishing Technology does not accept
legal responsibility for the contents of this message and any statements
contained herein which do not relate to the official business of Publishing
Technology are neither given nor endorsed by Publishing Technology and are
those of the individual and not of Publishing Technology. This message has
been scanned for viruses using the most current and reliable tools available
and Publishing Technology excludes all liability related to any viruses that
might exist in any attachment or which may have been acquired in transit.
--- End Message ---
--- Begin Message ---
Ok, turns out, after double checking my servers mysqli support using phpinfo(),
and doing a bit more research, and finding the following bit of
introductory/instructional/tutorial material, relating to the mysqli PHP
extension, on the php.net site itself, that other sample code I had found a
little while back was just incorrect syntactically itself - making use of
object oriented coding/approach, but excluding necessary keywords, like new,
etc., but anyway:
http://www.php.net/manual/en/intro.mysqli.php
In other words, whereas it had said:
$sql = mysqli("hostName", "user", "password", "database");
it should in fact have stated:
$sql = new mysqli("hostName", "user", "password", "database");
That meant you could then access properties and methods of the then
instantiated mysqli object using the -> operator, so, for a simple example of a
statement, instead of mysqli_close($sql); it would instead read $sql->close();
In other words, it primarily makes use of an object oriented approach to
database integration/manipulation, instead of the simple, procedural only
approach of just calling functions all the time, but anyway.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
--- End Message ---