Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pass user and pw to web server via php

    I am posting to a web service that require user authentication. I simply clear security in the normal dialog box and all is well.

    However I need to do this via a php script. I have everything ready to go other than trying to pass user and security to the site when posting.

    How can I do this. The user is an actual email address and the a password.

    I have tried the formation http://user@pw:www.postpage.com/post/ but since the user is an email address with the @ sign it seems to crap out. I haven't done this before so any help would be greatful.

    Thanks

  • #2
    New Coder
    Join Date
    Nov 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Found it... had to use the following:

    PHP Code:
    $headers .= "Authorization: Basic ".base64_encode($this->user.":".$this->pass)."\r\n"


  •  

    Posting Permissions

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