Shoutbox

Simple PHP code help - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Simple PHP code help (/showthread.php?tid=49623)

Simple PHP code help by DJeX on 08-28-2005 at 01:39 AM

Well since I'm totaly useless at PHP, how would I show this info:

HTTP_ACCEPT
HTTP_ACCEPT_ENCODING
HTTP_ACCEPT_LANGUAGE
HTTP_CONNECTION
HTTP_HOST
HTTP_USER_AGENT
REMOTE_ADDR
REMOTE_PORT
REQUEST_METHOD
REQUEST_URI


RE: Simple PHP code help by KeyStorm on 08-28-2005 at 01:57 AM

code:
<?php
echo '<pre>';
print_r($_SERVER);
?>

Don't blame my HTML :refuck:

This will show all server and connection related env vars. If you only want to show some of them do as many

echo $_SERVER['NAME_OF_KEY']."\n";

as you like instead of the print_r().
RE: Simple PHP code help by DJeX on 08-30-2005 at 01:41 AM

Thanks, now is it possible to get:

HTTP_FORWARDED
HTTP_X_FORWARDED_FOR
HTTP_VIA
HTTP_XROXY_CONNECTION
HTTP_PROXY_CONNECTION
HTTP_USERAGENT_VIA


RE: Simple PHP code help by Jhrono on 08-30-2005 at 01:46 AM

I think it's the same thing...do this php code :

code:
<?php
echo "<pre>";
print_r get_defined_vars();
?>

To see what info you can show with

$_Server['X'], where X is any of the variables pre defined, showed in the php code..
RE: Simple PHP code help by DJeX on 08-30-2005 at 01:49 AM

Ahhh ok, I thought

HTTP_FORWARDED
HTTP_X_FORWARDED_FOR
HTTP_VIA
HTTP_XROXY_CONNECTION
HTTP_PROXY_CONNECTION
HTTP_USERAGENT_VIA

Were only for CGI, but I guess it works for PHP too.


RE: Simple PHP code help by fluffy_lobster on 08-30-2005 at 12:19 PM

I presume you mean perl. PHP is a form of CGI and as it performs the same workflow stage as perl yes it can do all the same things.

Now somebody's going to come and yell at me since PHP doesn't have to be a webserver module :P


RE: Simple PHP code help by Concord Dawn on 08-30-2005 at 02:13 PM

quote:
Originally posted by fluffy_lobster
I presume you mean perl. PHP is a form of CGI and as it performs the same workflow stage as perl yes it can do all the same things.

Now somebody's going to come and yell at me since PHP doesn't have to be a webserver module :P

* Concord Dawn yells at fluffy_lobster :refuck:

But yes, you are correct. As far as I know, any form of server side scripting (Perl, PHP, ASP, etc) can get any of those variables. All it boils down to is preference of coding language.

Correct me if I'm wrong