[PHP] To Capture HTTP Headers

2006-05-10 Thread Kaushal Shriyan

I have put the below in test.php



I am getting the below information which is not formatted

array(5) { ["RSP_COOKIE"]=> string(28) "type=1&name=YW1pdA==&stype=0"
["RSP_DAEMON"]=> string(32) "9d07e725d2294db468407bb19badd8c2"
["MC_CMP_ESK"]=> string(8) "NonSense" ["SNS_AA"]=> string(21)
"asrc=2&sst=1147240052" ["RSP_LOCAL_BDC31096E_IN_OFFICE_AOL_COM"]=>
string(69) 
"djEgMFM=-TmmsenypEfMWJkDnPN+CQxyGILJnPlmYy1ajY1AHte/f7vUdwz9J0QOyI8E="
} array(27) { ["HOSTNAME"]=> string(9) "bdc31096e" ["SHELL"]=>
string(9) "/bin/bash" ["TERM"]=> string(5) "xterm" ["HISTSIZE"]=>
string(4) "1000" ["CATALINA_HOME"]=> string(39)
"/usr/local/tomcat/jakarta-tomcat-4.1.31" ["SSH_CLIENT"]=> string(22)
"10.146.145.159 3786 22" ["QTDIR"]=> string(15) "/usr/lib/qt-3.1"
["SSH_TTY"]=> string(10) "/dev/pts/1" ["USER"]=> string(4) "root"
["LD_LIBRARY_PATH"]=> string(23) "/usr/local/apache//lib:"
["LS_COLORS"]=> string(440)
"no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:"
["USERNAME"]=> string(4) "root" ["PATH"]=> string(114)
"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/local/j2sdk1.4.2_10/bin"
["MAIL"]=> string(20) "/var/spool/mail/root" ["PWD"]=> string(22)
"/usr/local/apache/conf" ["INPUTRC"]=> string(12) "/etc/inputrc"
["JAVA_HOME"]=> string(25) "/usr/local/j2sdk1.4.2_10/" ["LANG"]=>
string(11) "en_US.UTF-8" ["SSH_ASKPASS"]=> string(38)
"/usr/libexec/openssh/gnome-ssh-askpass" ["HOME"]=> string(5) "/root"
["SHLVL"]=> string(1) "2" ["BASH_ENV"]=> string(13) "/root/.bashrc"
["LOGNAME"]=> string(4) "root" ["SSH_CONNECTION"]=> string(37)
"10.146.145.159 3786 10.146.144.147 22" ["LESSOPEN"]=> string(24)
"|/usr/bin/lesspipe.sh %s" ["G_BROKEN_FILENAMES"]=> string(1) "1"
["_"]=> string(28) "/usr/local/apache//bin/httpd" }

Actually If I run my test.cgi file I get well formatted one and also
If you can see from the output
HTTP_USERNAME  
nick="amit",Master="0",acct_no_hash="1B2M2Y8AsgTpgAmY7PhCfg==",EMAIL="[EMAIL PROTECTED]"

which is missing from test.php script

Thanks Again

Kaushal

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] To capture Http Headers

2006-05-10 Thread Stut

Please reply to the list and not just directly to me.

Kaushal Shriyan wrote:


Thanks Stut

I have put the below script in test.php



I am getting the below information which is not formatted

array(5) { ["RSP_COOKIE"]=> string(28) "type=1&name=YW1pdA==&stype=0"
["RSP_DAEMON"]=> string(32) "9d07e725d2294db468407bb19badd8c2"
["MC_CMP_ESK"]=> string(8) "NonSense" ["SNS_AA"]=> string(21)
"asrc=2&sst=1147240052" ["RSP_LOCAL_BDC31096E_IN_OFFICE_AOL_COM"]=>
string(69) 
"djEgMFM=-TmmsenypEfMWJkDnPN+CQxyGILJnPlmYy1ajY1AHte/f7vUdwz9J0QOyI8E="

} array(27) { ["HOSTNAME"]=> string(9) "bdc31096e" ["SHELL"]=>
string(9) "/bin/bash" ["TERM"]=> string(5) "xterm" ["HISTSIZE"]=>
string(4) "1000" ["CATALINA_HOME"]=> string(39)
"/usr/local/tomcat/jakarta-tomcat-4.1.31" ["SSH_CLIENT"]=> string(22)
"10.146.145.159 3786 22" ["QTDIR"]=> string(15) "/usr/lib/qt-3.1"
["SSH_TTY"]=> string(10) "/dev/pts/1" ["USER"]=> string(4) "root"
["LD_LIBRARY_PATH"]=> string(23) "/usr/local/apache//lib:"
["LS_COLORS"]=> string(440)
"no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:" 


["USERNAME"]=> string(4) "root" ["PATH"]=> string(114)
"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/local/j2sdk1.4.2_10/bin" 


["MAIL"]=> string(20) "/var/spool/mail/root" ["PWD"]=> string(22)
"/usr/local/apache/conf" ["INPUTRC"]=> string(12) "/etc/inputrc"
["JAVA_HOME"]=> string(25) "/usr/local/j2sdk1.4.2_10/" ["LANG"]=>
string(11) "en_US.UTF-8" ["SSH_ASKPASS"]=> string(38)
"/usr/libexec/openssh/gnome-ssh-askpass" ["HOME"]=> string(5) "/root"
["SHLVL"]=> string(1) "2" ["BASH_ENV"]=> string(13) "/root/.bashrc"
["LOGNAME"]=> string(4) "root" ["SSH_CONNECTION"]=> string(37)
"10.146.145.159 3786 10.146.144.147 22" ["LESSOPEN"]=> string(24)
"|/usr/bin/lesspipe.sh %s" ["G_BROKEN_FILENAMES"]=> string(1) "1"
["_"]=> string(28) "/usr/local/apache//bin/httpd" }



Yes, this is called HTML. Output in a  tag to get it formatted.


Actually If I run my test.cgi file I get well formatted one I am
attaching the screenshot also If you can see from the output
HTTP_USERNAME  
nick="amit",Master="0",acct_no_hash="1B2M2Y8AsgTpgAmY7PhCfg==",EMAIL="[EMAIL PROTECTED]" 


which is missing from test.php script output



I see no screenshot (which is a good thing, so please *don't* repost 
with the screenshot). What type of authentication is HTTP_USERNAME 
supposed to be coming from?


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] To capture Http Headers

2006-05-09 Thread Richard Lynch


Wild Guess:



You're on your own for adding in the HTML and Javascript crap.

On Tue, May 9, 2006 9:36 am, Kaushal Shriyan wrote:
> Hi ALL
>
> I have a sample cgi-script
>
> #!/usr/bin/perl
>
> use CGI;
>
> $cgi = new CGI;
>
> for $key ( $cgi->param() ) {
> $input{$key} = $cgi->param($key);
> }
>
> print qq{Content-type: text/html
>
>  src="/domain.js">
> };
>
> print qq{addHeader()};
>
> print qq{ cellpadding="2">};
> print qq{KeyValue};
>
> foreach $key (sort (keys %ENV)) {
> print "$key", "$ENV{$key}", "";
> }
>
> print qq{};
>
> print qq{addFooter()};
> print qq{};
>
> Can any one please help me in converting this to a php script
>
> Which would be of great help
>
> Thanks in Advance
>
> Kaushal
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] To capture Http Headers

2006-05-09 Thread Jochem Maas

Kaushal Shriyan wrote:

On 5/9/06, Jochem Maas <[EMAIL PROTECTED]> wrote:





Thanks Jochem Maas

Thanks a Lot

so it would look like below if i put in test.php




echo "";
ksort($_GET);
foreach ($_GET as $key => $val) {
  echo "{$key}: {$val}";
}
echo "";


yes if you put that in test.php that is what it would
look like - why don't you try it???

(hint everything after '?>' will be shown in the browser as
is rather than being parsed by php because php only parses
stuff it finds between '')

have you actually read any at php.net? (e.g.
http://nl2.php.net/manual/en/tutorial.php)



Please advice


advise not advice. verb not noun.

'advise' is what I *do* when I give you some hints
about how to achieve what your trying to.

an example of 'advice'  would be 'RTFM please'.



Thanks in Advance

Kaushal


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] To capture Http Headers

2006-05-09 Thread Jochem Maas

Kaushal Shriyan wrote:

Hi ALL

I have a sample cgi-script

#!/usr/bin/perl

use CGI;

$cgi = new CGI;

for $key ( $cgi->param() ) {
   $input{$key} = $cgi->param($key);
}


check out the superglobals $_POST, $_GET and $_REQUEST:





print qq{Content-type: text/html



this header is outputted automatically.



};







';
?>



print qq{addHeader()};

print qq{};
print qq{KeyValue};

foreach $key (sort (keys %ENV)) {
   print "$key", "$ENV{$key}", "";
}


echo "";
ksort($_GET);
foreach ($_GET as $key => $val) {
echo "{$key}: {$val}";
}
echo "";



print qq{};

print qq{addFooter()};
print qq{};

Can any one please help me in converting this to a php script


that should be enough help for anyone who can read/write perl ;-P



Which would be of great help

Thanks in Advance

Kaushal



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] To capture Http Headers

2006-05-09 Thread Stut

Kaushal Shriyan wrote:


Hi ALL

I have a sample cgi-script





Can any one please help me in converting this to a php script

Which would be of great help



Try it yourself. If you have problems check the manual 
(http://php.net/docs), STFW (http://www.google.com/) and if you can't 
find an answer email this list again with a detailed description of your 
problem and sample code where appropriate.


We Ar' No' He' To Do Yo' Jo' Fo' Yo'!

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] To capture Http Headers

2006-05-09 Thread Kaushal Shriyan

Hi ALL

I have a sample cgi-script

#!/usr/bin/perl

use CGI;

$cgi = new CGI;

for $key ( $cgi->param() ) {
   $input{$key} = $cgi->param($key);
}

print qq{Content-type: text/html


};

print qq{addHeader()};

print qq{};
print qq{KeyValue};

foreach $key (sort (keys %ENV)) {
   print "$key", "$ENV{$key}", "";
}

print qq{};

print qq{addFooter()};
print qq{};

Can any one please help me in converting this to a php script

Which would be of great help

Thanks in Advance

Kaushal

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php