Jump to content

prashcom

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

prashcom's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello friends, I am in big problem and i need help from you guys... My problem is i want to run a php file for forever.... I used fsockopen for this and its seems its working all fine but i think somehow i am doing somewhere silly mistake... This is my code: The file name is "list-items.php", same as what i am going to call again using this socket connection. mail('example@abc.com','hi','helllo'); sleep(5); if($_SERVER['SERVER_ADDR'] != '127.0.0.1') { $socket = fsockopen("www.example.com", 80, $errno, $errstr, 10); if (!$socket) { //echo "$errstr ($errno)<br />\n"; echo "Error in socket connection............."; } else { $out = "GET list-items.php HTTP/1.1\r\n"; $out .= "Host: www.example.com\r\n"; $out .= "Connection: Close\r\n\r\n"; if (fwrite($socket, $out) === FALSE) { echo "error........."; } fclose($socket); } } I am really confuse after seeing the output of this code.... This code is opening lots of threads with same instance... Will anyone pls tell me how this will work... My only job is to open a file in php such a way so will call itself after performing the desired task, in every 2-3 second... Is there anyway i can achive the task? I think cron is not good as will not run in such frequently.... my server support atleast 2minute gap.... so i think socket can do this job but why this example opening multiple threads instead of only one socket connection?
  2. Hi All, I want to upload my txt file using curl file upload. Its not working properly. I used Mozilla Live Http header but i was no luck. Seems all fine.. i need the solution very urgently.. My porblem is ... How to upload file using culr.. this is code i am using: $httpheaders[]="Authorization: Basic $auth"; $httpheaders[]="Content-Type: text/xml"; $httpheaders[] = "FileFormat: TabDelimited"; $filePath = 'TOOLS.TXT'; $postParams = "@$filePath"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); // set URL curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch,CURLOPT_POSTFIELDS,$postParams); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return result in a variable curl_setopt($ch, CURLOPT_HEADER, 1); // include headers in result curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheaders); // send my headers $postResult = curl_exec($ch); if (curl_errno($ch)) { print curl_error($ch); print "<br>Unable to upload file."; exit(); } curl_close($ch); echo "<pre>$postResult</pre>"; This script is not working fine.. Please help me out
  3. Hi I am working on amazon and what they are doing is if i am doing any request in curl then they are sending the response as chunked data. Now my problem is how i will read this data. I can read this data but not able to completely parse it.. This is my code : $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); // set URL curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return result in a variable curl_setopt($ch, CURLOPT_HEADER, 1); // include headers in result curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheaders); // send my headers $result = curl_exec($ch); //get the default response headers $headers = curl_getinfo($ch); //print_r($headers); curl_close($ch); and this is my response HTTP/1.1 200 OK x-amzn-request-id: a77f37e2-2247-4aba-8d39-54da9e831ea6 Content-Type: application/octet-stream Transfer-Encoding: chunked Date: Fri, 26 Oct 2007 17:46:24 GMT Server: MFA Query Service and this is the actual content what i am trying to filter : order-id order-item-id purchase-date payments-date buyer-email buyer-name buyer-phone-number sku product-name quantity-purchased currency item-price item-tax shipping-price shipping-tax ship-service-level recipient-name ship-address-1 ship-address-2 ship-address-3 ship-city ship-state ship-postal-code ship-country ship-phone-number delivery-start-date delivery-end-date delivery-time-zone delivery-Instructions 203-7894296-3757945 07802496435979 2007-10-25T06:46:25-07:00 2007-10-25T06:46:25-07:00 dead@btinternet.com simon brown 02082913628 B000T5N0JE Advanced Mouse Trap 3 GBP 5.85 0.00 5.50 0.00 Standard simon brown 166 kilmorie road forest hill london london se232sr GB 02082913628 so i need this content in name->value pair and some where i am doing mistake to read the content properly.. Will any one pls guide me what needs to do here? Thanks Prashant Agarwal http://prashcom.blogspot.com
  4. Hi, I want a php solution so i can send billions of message. I am really not too much friendly with email technology and dummy in this area. So please sussest me what will be the best solution for this? My problem is: 1. How to send mails in bulk, if i am planning to launch a email solution like, http://www.emailcenteruk.com/. 2. What all requirement we need in server 3. Is there any php inbulid library which we can use to send bulk mails, 4. How to make sure the mails are not going in spam, is php's SMTP class is the solution. 5. Is there anything called email server, if yes then how much useful that will be for this project? 6. If i want to send only 10K email daily/monthly then what u guys will suggest, apart from 1 billion in a day ? Please answer this question i have lots of questions regarding email issue. Thanks Prashant Agarwal
×
×
  • 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.