SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XHR header? sometimes not there?

    I am using prototype for the request.

    I have tried this on my desktop and it work, but same thing on my laptop does not work? I am using apache 2.2.6 and PHP 5.2.4 does anybody know why the headers:

    $_SERVER['HTTP_X_REQUESTED_WITH']

    Do not exists on the laptop?
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  2. #2
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you get back from apache_request_headers?

  3. #3
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well i dont have that availalbe but i get this from $_SERVER..

    Code:
        [HTTP_HOST] => localhost
    
        [HTTP_USER_AGENT] => Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b5) Gecko/2008032620 Firefox
    
    /3.0b5
    
        [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    
        [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
    
        [HTTP_ACCEPT_ENCODING] => gzip,deflate
    
        [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
    
        [HTTP_KEEP_ALIVE] => 300
    
        [HTTP_CONNECTION] => keep-alive
    
        [HTTP_COOKIE] => fontSize=220; phpbb3_pk2f3_u=2; phpbb3_pk2f3_k=b6aa48909d8be51e; phpbb3_pk2f3_sid
    
    =4e9511c5173491d221a32422f5bc4855; style_cookie=null; phpbb3_b1rn3_u=1; phpbb3_b1rn3_k=; phpbb3_b1rn3_sid
    
    =d83eb9be761f32ca9ff54d8c75a31ef7; phpbb3_q4njq_k=; phpbb3_q4njq_u=2; phpbb3_q4njq_sid=8e58fb9faf4651c10f289daee3e5c379
    
    ; phpbb3_4ysjq_k=; phpbb3_4ysjq_u=2; phpbb3_4ysjq_sid=30639498cccbb609e0d63ea349a14e35
    
        [PATH] => C:\Program Files\Autodesk\Maya2008\bin;C:\Program Files\Autodesk\Maya8.5\bin;C:\Windows
    
    \system32;C:\Windows;C:\Windows\System32\Wbem;C:\wamp\php;C:\Windows\System32\WindowsPowerShell\v1.0
    
    \;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Subversion\bin;C:\Program Files\Toon Boom Animation
    
    \Toon Boom StoryboardProTrial\nt\bin
    
        [SystemRoot] => C:\Windows
    
        [COMSPEC] => C:\Windows\system32\cmd.exe
    
        [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    
        [WINDIR] => C:\Windows
    
        [SERVER_SIGNATURE] => 
    
        [SERVER_SOFTWARE] => Apache/2.2.6 (Win32) PHP/5.2.4
    
        [SERVER_NAME] => localhost
    
        [SERVER_ADDR] => 127.0.0.1
    
        [SERVER_PORT] => 80
    
        [REMOTE_ADDR] => 127.0.0.1
    
        [DOCUMENT_ROOT] => C:/wamp/www/
    
        [SERVER_ADMIN] => webmaster@localhost
    
        [SCRIPT_FILENAME] => C:/wamp/www/test/validate.php
    
        [REMOTE_PORT] => 55620
    
        [GATEWAY_INTERFACE] => CGI/1.1
    
        [SERVER_PROTOCOL] => HTTP/1.1
    
        [REQUEST_METHOD] => POST
    
        [QUERY_STRING] => 
    
        [REQUEST_URI] => /test/validate.php
    
        [SCRIPT_NAME] => /test/validate.php
    
        [PHP_SELF] => /test/validate.php
    
        [REQUEST_TIME] => 1210010393
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  4. #4
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And the strange thing is.. firebug says that it is doing the request with the headers?

    Code:
    Request Headers
    Host    localhost
    User-Agent    Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5
    Accept    text/javascript, text/html, application/xml, text/xml, */*
    Accept-Language    en-us,en;q=0.5
    Accept-Encoding    gzip,deflate
    Accept-Charset    ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive    300
    Connection    keep-alive
    X-Requested-With    XMLHttpRequest
    X-Prototype-Version    1.6.0
    Content-Type    application/x-www-form-urlencoded; charset=UTF-8
    Referer    http://localhost/test/form.php
    Content-Length    28
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  5. #5
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    [GATEWAY_INTERFACE] => CGI/1.1
    Is PHP running as CGI behind Apache?

  6. #6
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kyberfabrikken View Post
    Code:
    [GATEWAY_INTERFACE] => CGI/1.1
    Is PHP running as CGI behind Apache?
    Well the thing is it just a WAMP Server (http://www.wampserver.com/en/) intall.. the only difference is that the desktop runs XP x64 and laptop Vista x86.

    I am not sure where to check if it's CGI or not... but even then should it matter ?
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  7. #7
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pixelsoul View Post
    Well the thing is it just a WAMP Server (http://www.wampserver.com/en/) intall..
    Well, then it's probably not running as CGI, since that would be an atypical configuration.

    Quote Originally Posted by pixelsoul View Post
    I am not sure where to check if it's CGI or not... but even then should it matter ?
    I haven't been using the cgi much, so I'm not 100% sure about the differences, but I think you might get only some headers across with that.

    Have you tried the WAMP forum? It sounds like a configuration problem with your server.

  8. #8
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm but how reliable is it to trust on these headers?

    Quote Originally Posted by kyberfabrikken View Post
    Well, then it's probably not running as CGI, since that would be an atypical configuration.

    I haven't been using the cgi much, so I'm not 100% sure about the differences, but I think you might get only some headers across with that.

    Have you tried the WAMP forum? It sounds like a configuration problem with your server.
    Go visit my site :-D you know you want to ;-)
    www.mech7.net


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •