Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-29-2012, 03:27 AM   PM User | #1
sorlaker
Regular Coder

 
Join Date: Dec 2009
Posts: 166
Thanks: 23
Thanked 1 Time in 1 Post
sorlaker has a little shameless behaviour in the past
PHP + Curl to simulate live http headers?

Is there a way that i can check live http headers exactly as firefox addon (Live http headers) sees?
sorlaker is offline   Reply With Quote
Old 12-29-2012, 08:18 AM   PM User | #2
Redcoder
Regular Coder

 
Redcoder's Avatar
 
Join Date: May 2012
Location: /dev/couch
Posts: 309
Thanks: 2
Thanked 46 Times in 45 Posts
Redcoder has a little shameless behaviour in the past
Try this get_headers():

PHP Code:
$url 'http://www.codingforums.com';

echo 
"<pre>";

print_r(get_headers($url1));

echo 
"</pre>"

That will output something like:

Code:
Array
(
    [0] => HTTP/1.1 200 OK
    [Date] => Sat, 29 Dec 2012 08:19:04 GMT
    [Server] => Apache/2.2.10 (Unix) mod_ssl/2.2.10 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_bwlimited/1.4 PHP/5.2.6
    [X-Powered-By] => PHP/5.2.6
    [Set-Cookie] => Array
        (
            [0] => bbsessionhash=cb9550ca1e0e70135402c4cbf73e736b; path=/; HttpOnly
            [1] => bblastvisit=1356769144; expires=Sun, 29-Dec-2013 08:19:04 GMT; path=/
            [2] => bblastactivity=0; expires=Sun, 29-Dec-2013 08:19:04 GMT; path=/
        )

    [Expires] => 0
    [Cache-Control] => private, post-check=0, pre-check=0, max-age=0
    [Pragma] => no-cache
    [X-UA-Compatible] => IE=7
    [Connection] => close
    [Content-Type] => text/html; charset=ISO-8859-1
)
If you want to spoof stuff like UserAgent, that can be easily done using cURL.
__________________
For professional Hosting and Web design.....


NetEssentials.co.uk
Redcoder is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:58 AM.


Advertisement
Log in to turn off these ads.