cURL / Mailing Lists / curl-users / Single Mail


Passing Username and Password via PHP into curl - Suggestions

From: Keith Stiles <>
Date: Wed, 10 Aug 2011 16:07:55 -0400


I have been working on a script that iterates through a CSV file creating
some data that is uploaded to a webservices implementation. The script
successfully uploads. the command line for the curl in my PHP script is as

passthru ('curl -k -u *username*:*password* -F

The curl works if I physically enter my username and password in the
location. However, if I try to pass the values of variables to the curl as

passthru ('curl -k -u $username.":".$password -F

The curl command fails to successfully pass the authorization to the

I have verified that the $username and $password variables are populated
with the correct values. Any ideas how I could get this to work?


Keith Stiles
Webmaster/Web Services
Blue Ridge Community College
180 West Campus Drive
Flat Rock, NC 28731-4728
Phone: (828) 694-1894

Our mission...enriching the lives of those within our reach through
education, training and cultural activities.
E-mail correspondence to and from this address is subject to the
North Carolina Public Records Law. (NCGS.Ch.132)

List admin:
Received on 2011-08-10