Jump to content

balasun

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

balasun's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello all, I made the process to upload files to remote server using PHP curl. The upload is done without any problem. But i need to display the progressbar during upload, But the progress details does not return during upload. My code is as follows function progress($clientp,$dltotal,$dlnow,$ultotal,$ulnow){ echo "$clientp, $dltotal, $dlnow, $ultotal, $ulnow"; return(0); } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'the uploadurl in server'); curl_setopt($ch, CURLOPT_POST, 1 ); print_r($this->postParams); curl_setopt($ch, CURLOPT_POSTFIELDS, 'postparams'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_MAX_SEND_SPEED_LARGE,5000); curl_setopt($ch,CURLOPT_PROGRESSFUNCTION,'progress'); curl_setopt($ch,CURLOPT_NOPROGRESS,false); echo $postResult = curl_exec($ch); if (curl_errno($ch)) { print curl_error($ch); print "<br>Unable to upload file."; exit(); } curl_close($ch); exit(); Pls help me if any body knows the answer.. Thanks
  2. Hello all, I need to excute the oracle query like Below: "begin myfriends_data.get_multi_rows_details(:StartDate, :EndDate, :filed3, :filed4, ); end"; I give the StartDate value as '01/01/2009'; But when i execute the query,i got the error like Below: ORA-01843: not a valid month ORA-06512: at line 2 Pls help me how to solve the problem. Thanks,
  3. Hello all, I need PHP script to import contacts( Email address, Name) From linkedin site for one user by entering username and password. Is any Free source available for these process in any of the site? Pls Help me if u know about these... Thanks,
  4. Thanks for your reply. $cookie_jar = tempnam('tmp/','cookie'); $url = "https://www.linkedin.com/secure/login"; $POSTFIELDS = 'session_key=balasun08@gmail.com&session_password=balasundar&session_login=&session_rikey=invalid key'; $reffer = "http://www.linkedin.com"; $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $cookie_file_path = "tmp/cookie.txt"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_REFERER, $reffer); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); $info = curl_getinfo($ch); if ($output === false || $info['http_code'] != 200) { echo "No cURL data returned for $url [". $info['http_code']. "]"; if (curl_error($ch)) echo curl_error($ch); } else { echo $output; } curl_close($ch); The response for the above code is : HTTP/1.1 200 OK P3P: CP="CAO DSP COR CUR ADMi DEVi TAIi PSAi PSDi IVAi IVDi CONi OUR DELi SAMi UNRi PUBi OTRi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT POL PRE" Set-Cookie: lang=en; Path=/ Set-Cookie: leo_auth_token=LIM:44196530:a:1239453972:9e48176347a87ffcfd1c38665759382420525840; Expires=Sun, 11-Apr-2010 12:46:11 GMT; Path=/ Set-Cookie: s_leo_auth_token=LIM:44196530:s:1239453972:fd25536840e9f9d830dea845f0e999d3b90778f7; Path=/; Secure Set-Cookie: JSESSIONID=ajax:2419585623651592777; Path=/ Set-Cookie: visit=G; Expires=Thu, 29-Apr-2077 16:00:19 GMT; Path=/ Set-Cookie: bcookie=586984c0-7454-41bd-9f9a-6abca917912f; Expires=Thu, 29-Apr-2077 16:00:19 GMT; Path=/ Content-Type: text/html;charset=UTF-8 Content-Length: 1059 Date: Sat, 11 Apr 2009 12:46:12 GMT Server: Apache-Coyote/1.1 Set-Cookie: NSC_MC_QH_MFP=e2420fe529a3;expires=Sat, 11-Apr-09 14:17:45 GMT;path=/ Authentication does not done. Pls help me what i do next?
  5. Hello all, I am using PHP curl function to login in secure server site by post the parameters. My code is as follows: $cookie_jar = tempnam('tmp/','cookie'); $url = "https://nameos site/login"; $POSTFIELDS = 'session_key=emailid&session_password=password&session_login=&session_rikey=invalid key'; $reffer = "http://www.securesitename.com"; $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $cookie_file_path = "tmp/"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_REFERER, $reffer); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); echo $result = curl_exec($ch); exit; curl_close($ch); But the login does not done. Pls help me to do login.. Is any special parameters need when we use CURL for secured site?
  6. Hello, I used to access another site data using PHP ,curl. The access is working well. But the After access redirection to my site does not takes place.. My code is as follows: class test { var $login = ""; /** * LinkedIn Account Password * @public * @var string */ var $password = ""; /** * Sets the output format * - For Array format : array * - For XML format : xml * - Default : array * @public * @var string */ var $outputFormat = "array"; // var $outputFormat = "xml"; /** * Abosolute path to save the cookie * Default value is DOCUMENT_ROOT * @public * @var string */ var $cookieJarPath = ""; /** * Abosulte path to the CA Bundle file * SSL Certificate required to verify CA cert * Usually required when script ran on Localhost * Remote servers may not require * Default value is false * @public * @var string */ var $caBundleFile = ""; /** * Specifies if Proxy server required as Gateaway * Default value is false * @public * @var boolean */ var $isUsingProxy = false; /** * Proxy host name * @public * @var string */ var $proxyHost = ""; /** * Proxy port number * @public * @var int */ var $proxyPort = 0; /*------------------------------------------------------- Private Variables -------------------------------------------------------*/ /** * URL to Authenticate user on LinkedIn * @private * @var string */ var $authUrl = "https://www.linkedin.com/secure/login"; /** * URL for the desired Service * @private * @var string */ //var $serviceUrl = "http://www.linkedin.com/addressBookExport"; // var $serviceUrl = "http://www.linkedin.com/connections?trk=hb_side_cnts"; var $serviceUrl = ""; /** * User agent (used to trick LinkedIn) * @private * @var string */ var $userAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"; /** * Referer URL (used to trick LinkedIn) * @private * @var string */ var $referer = "http://www.linkedin.com"; /** * Specifies whether output includes the header * @private * @var int */ var $showHeader = 0; /** * Specifies if cURL should follow the redirected URL * @private * @var int */ var $follow = 0; /** * Specifies if cURL should return the output as string * @private * @var int */ var $returnTransfer = 1; /** * Specifies if cURL should verify peer certificate * @private * @var int */ var $sslVerifyPeer = 0; /** * Specifies number of post fields to pass * @private * @var int */ var $numPostField = 0; /** * Specify fields to send via POST method as key=value * @private * @var string */ var $postFields = ""; /** * File where output is temporarily saved during authentication * @private * @var string */ var $authOutputFile = ""; /** * File where service output is temporarily saved * @private * @var string */ var $outputFile = ""; /** * File where Cookie is temporarily saved * @private * @var string */ var $cookieFileJar = ""; /** * Cookie File that is read by service process * This carries same value as $cookieFileJar * @private * @var string */ var $cookieFile = ""; /** * Specifies if Cookie is to be in header * @private * @var int */ var $cookie = 0; /** * Proxy address as proxy.host:port * @private * @var string */ var $proxy = ""; /** * Error Information set by either cURL or Internal process * @private * @var string */ var $errorInfo = ""; /** * Output of Contact List * @private * @var array */ var $list = array(); function setCurlOption() { // Sets the User Agent curl_setopt($this->curlSession, CURLOPT_USERAGENT, $this->userAgent); curl_setopt($this->curlSession, CURLOPT_FOLLOWLOCATION, true); curl_setopt($this->curlSession, CURLOPT_BINARYTRANSFER, 0); // Sets the HTTP Referer curl_setopt($this->curlSession, CURLOPT_REFERER, $this->referer); // Sets the URL that PHP will fetch using cURL curl_setopt($this->curlSession, CURLOPT_URL, $this->url); // Sets the number of fields to be passed via HTTP POST curl_setopt($this->curlSession, CURLOPT_POST, $this->numPostField); // Sets the fields to be sent via HTTP POST as key=value curl_setopt($this->curlSession, CURLOPT_POSTFIELDS, $this->postFields); //curl_setopt($this->curlSession, CURLOPT_FOLLOWLOCATION, 1); // curl_setopt($this->curlSession, CURLOPT_RETURNTRANSFER, 1); // Sets the filename where cookie information will be saved // curl_setopt($this->curlSession, CURLOPT_COOKIEJAR, $this->cookieFileJar); // Sets the filename where cookie information will be looked up //curl_setopt($this->curlSession, CURLOPT_COOKIEFILE, $this->cookieFile); // Sets the option to set Cookie into HTTP header // curl_setopt($this->curlSession, CURLOPT_COOKIE, $this->cookie); // Checks if the user needs proxy (to be set by user) if ($this->isUsingProxy) { // Checks if the proxy host and port is specified if ((empty($this->proxyHost)) || (empty($this->proxyPort))) { $this->setError("proxy_required"); $this->unlinkFile($this->cookieFileJar); return false; } // Sets the proxy address as proxy.host:port $this->proxy = $this->proxyHost . ":" . $this->proxyPort; } // Sets the proxy server as proxy.host:port curl_setopt($this->curlSession, CURLOPT_PROXY, $this->proxy); // Sets the filename where output will be temporarily saved //Prob // curl_setopt($this->curlSession, CURLOPT_RETURNTRANSFER, $this->returnTransfer); // Sets to false if the authentication URL is a secured server address // curl_setopt($this->curlSession, CURLOPT_SSL_VERIFYPEER, $this->sslVerifyPeer); // curl_setopt($this->curlSession, CURLOPT_FOLLOWLOCATION, $this->follow); return true; } } Pls help me to do redirection to my site after access.. Thanks,
  7. Hello all, I used PHP curl function to fetch data from other site. I got the result from the site. In the result, i need to get Email id's. But in site that i fetched, the email id's are get using AJAX and results are assigned to one div innerHTML. In my curl output the loading image is only displayed.the email id;s are not displayed. How can i call that AJAX function and get the result when i get output using CURL. Pls help me if u know anything about it. Thanks,
  8. Hello, I need to read .pst files in the system for to get the Email address from outlook contacts.. When i use fopen for that.. The contents which has some special characters and not readable in browser. How it is possible? Pls help me if u knows anything about these.. Thanks,
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.