The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Automating Cpanel Login with PHP

Discussion in 'General Discussion' started by universal, Jan 6, 2003.

  1. universal

    universal Registered

    Joined:
    Dec 13, 2002
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi every one,

    When I type
    &http://cpanelusername:cpanelpwd@mywebsite.com/cpanel/& as my browser URL, I'm able to login directly w/o the http authentication window.

    But why is that the following PHP header funtion is not working in the same way, the following php page when called is working fine w/o any errors but the cpanel this time is returning with a http authentication window?

    &?header(&Location: http://cpanelusername:cpanelpwd@mywebsite.com/cpanel/&);
    ?&

    Any fault in my code ?

    /Universal
     
  2. mrprez

    mrprez Well-Known Member

    Joined:
    Jun 14, 2002
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    16
    Works for me.

    Mine looks the same as yours except I moved the command to it's own line away from the &?

    John
     
  3. cikul

    cikul Well-Known Member

    Joined:
    Nov 15, 2002
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    work fine with me ;)

    i use
    [quote:0a69e2ca75]
    &?
    header(&Location: http://cpanelusername:cpanelpwd@mywebsite.com/cpanel/&);
    ?&
    [/quote:0a69e2ca75]
     
  4. andyf

    andyf Well-Known Member

    Joined:
    Jan 7, 2002
    Messages:
    246
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK
    [quote:9e5e5d3178][i:9e5e5d3178]Originally posted by thaphantom[/i:9e5e5d3178]

    &? has to be &?PHP
    :)[/quote:9e5e5d3178]

    no, it doesn't.
     
  5. xnull

    xnull Well-Known Member

    Joined:
    Sep 9, 2001
    Messages:
    156
    Likes Received:
    0
    Trophy Points:
    16
    Ya, using the header method with php, I get an auth window too.. seems odd. Perhaps a bug in PHP or a bug in the location header of the browser?
     
  6. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    Maybe because they are two different web servers?
     
Loading...

Share This Page