RE: [PHP] A curl question
I haven't tried it, so I don't know if -d doesn't work with -u, but if that is the case, you could change your URL to this: curl -d what=what http://user:[EMAIL PROTECTED]/myApp.php or try this: curl -u userID:password -d what=what --url http://www.mydomain.com/myApp.php; HTH Ray Original Message Subject: RE: [PHP] A curl question From: tedd [EMAIL PROTECTED] Date: Mon, January 02, 2006 5:50 pm To: php-general@lists.php.net Ray: I would suggest using the -d (or --data) flag. That allows you to send POST data. example: exec(curl -d name=Rafael%20Sagulaphone=3320780 http://www.where.com/guest.php) Yes, I understand -d -- is there a way to use that AND to provide userID and password? Thanks. tedd For more information, check the man page for cURL and search for POST within that document. Or check out the PHP Manual for the appropriate CURL syntax with LibCURL http://us3.php.net/manual/en/function.curl-init.php I have a script that uses the exec statement (was inherited from the last guy) and I'd be interested to know if libCURL makes the script wait on that line until CURL returns the result. Sometimes when getting data from a really slow site, scripts will take a lot longer than expected (10-15 minutes). I would assume that both ways would have the same effect, but efficiency is always king ;) HTH Ray Original Message Subject: [PHP] A curl question From: tedd [EMAIL PROTECTED] Date: Mon, January 02, 2006 9:07 am To: php-general@lists.php.net Hi: I've asked this question on the [EMAIL PROTECTED] list, but replies were few and didn't address the problem. Whereas, I've seen considerable discussion of curl on this list, so here goes. I am writing a client-side application that uses curl commands to communicate with a php application. At present I can send the php application logon, password, and variables via: curl -u userID:password --url http://mydomain.com/myApp.php?what=what That works! However, I would like to send the variables hidden instead of attached to the url. So, what would the curl command be? Many thanks for any suggestions or solutions. tedd -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A curl question
I haven't tried it, so I don't know if -d doesn't work with -u, but if that is the case, you could change your URL to this: curl -d what=what http://user:[EMAIL PROTECTED]/myApp.php Ray: Bingo -- that worked ! Now I can send data to a password protected folder without having to expose the data by adding it to the end of the url. This is mondo cool. One step closer to world domination. Many thanks. tedd -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Curl Question
Thanks for the info! Manuel Lemos wrote: Hello, on 01/03/2006 06:52 PM Ray Hauge said the following: I just wanted to see if anyone knew if there was any difference in performance between using curl in an exec() statement and when using the libCurl functions within PHP. Executing a separate program should be a little slower as it adds some overhead before executing a request. Actually, in some cases it can be a little faster to use fsockopen instead of libcurl as it is one less library to load. You may also want to take a look at this HTTP client class that uses fsockopen everytime it is possible and only uses libcurl functions in certain cases. This class takes care of cookie handling, redirection, form posting, file uploading, etc.. http://www.phpclasses.org/httpclient -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A curl question
I would suggest using the -d (or --data) flag. That allows you to send POST data. example: exec(curl -d name=Rafael%20Sagulaphone=3320780 http://www.where.com/guest.php) For more information, check the man page for cURL and search for POST within that document. Or check out the PHP Manual for the appropriate CURL syntax with LibCURL http://us3.php.net/manual/en/function.curl-init.php I have a script that uses the exec statement (was inherited from the last guy) and I'd be interested to know if libCURL makes the script wait on that line until CURL returns the result. Sometimes when getting data from a really slow site, scripts will take a lot longer than expected (10-15 minutes). I would assume that both ways would have the same effect, but efficiency is always king ;) HTH Ray Original Message Subject: [PHP] A curl question From: tedd [EMAIL PROTECTED] Date: Mon, January 02, 2006 9:07 am To: php-general@lists.php.net Hi: I've asked this question on the [EMAIL PROTECTED] list, but replies were few and didn't address the problem. Whereas, I've seen considerable discussion of curl on this list, so here goes. I am writing a client-side application that uses curl commands to communicate with a php application. At present I can send the php application logon, password, and variables via: curl -u userID:password --url http://mydomain.com/myApp.php?what=what That works! However, I would like to send the variables hidden instead of attached to the url. So, what would the curl command be? Many thanks for any suggestions or solutions. tedd -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A curl question
On Mon, Jan 02, 2006 at 11:07:33AM -0500, tedd wrote: Hi: I've asked this question on the [EMAIL PROTECTED] list, but replies were few and didn't address the problem. Whereas, I've seen considerable discussion of curl on this list, so here goes. I am writing a client-side application that uses curl commands to communicate with a php application. At present I can send the php application logon, password, and variables via: curl -u userID:password --url http://mydomain.com/myApp.php?what=what That works! However, I would like to send the variables hidden instead of attached to the url. So, what would the curl command be? How do you mean hidden? You have to send the userid and pass somehow either with the -u option or specifying them in the url: http://userID:[EMAIL PROTECTED]/ If you are worried about people seing the network traffic of the username or passowrd then use https. Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A curl question
On Mon, Jan 02, 2006 at 11:07:33AM -0500, tedd wrote: Hi: I've asked this question on the [EMAIL PROTECTED] list, but replies were few and didn't address the problem. Whereas, I've seen considerable discussion of curl on this list, so here goes. I am writing a client-side application that uses curl commands to communicate with a php application. At present I can send the php application logon, password, and variables via: curl -u userID:password --url http://mydomain.com/myApp.php?what=what That works! However, I would like to send the variables hidden instead of attached to the url. So, what would the curl command be? How do you mean hidden? You have to send the userid and pass somehow either with the -u option or specifying them in the url: http://userID:[EMAIL PROTECTED]/ If you are worried about people seing the network traffic of the username or passowrd then use https. Curt. Curt: Thanks for your reply. To answer you question, hidden means, as I said, data that is NOT attached to the url as found in the curl example I provided. Please note that the userID and password are NOT the data that I speak of. Besides, I am not worried about the ID or password being shown, because it isn't. What I am concerned about -- however -- is sending data attached to the end of the url because I would like to hide that from the user. For example, typically input statements in forms provide hidden data -- but unfortunately, my client-side application cannot mimic a form. So, let me state the problem again. I have written a client-side application that communicates very well with a php application. The php application requires authorization and the curl command I use to provide this authorization with subsequent data is as follows: curl -u userID:password --url http://mydomain.com/myApp.php?what=what Now, what I am asking is -- is there a curl command that will send both id:password AND data without attaching data to the end of the url string? Is there such a critter? Thanks, tedd PS: Please don't tell me to use a php-command or php-function because this is for a client side application that can only use curl commands to communicate with a php application. -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A curl question
Ray: I would suggest using the -d (or --data) flag. That allows you to send POST data. example: exec(curl -d name=Rafael%20Sagulaphone=3320780 http://www.where.com/guest.php) Yes, I understand -d -- is there a way to use that AND to provide userID and password? Thanks. tedd For more information, check the man page for cURL and search for POST within that document. Or check out the PHP Manual for the appropriate CURL syntax with LibCURL http://us3.php.net/manual/en/function.curl-init.php I have a script that uses the exec statement (was inherited from the last guy) and I'd be interested to know if libCURL makes the script wait on that line until CURL returns the result. Sometimes when getting data from a really slow site, scripts will take a lot longer than expected (10-15 minutes). I would assume that both ways would have the same effect, but efficiency is always king ;) HTH Ray Original Message Subject: [PHP] A curl question From: tedd [EMAIL PROTECTED] Date: Mon, January 02, 2006 9:07 am To: php-general@lists.php.net Hi: I've asked this question on the [EMAIL PROTECTED] list, but replies were few and didn't address the problem. Whereas, I've seen considerable discussion of curl on this list, so here goes. I am writing a client-side application that uses curl commands to communicate with a php application. At present I can send the php application logon, password, and variables via: curl -u userID:password --url http://mydomain.com/myApp.php?what=what That works! However, I would like to send the variables hidden instead of attached to the url. So, what would the curl command be? Many thanks for any suggestions or solutions. tedd -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php