Posts Tagged Url
Uploading a file using Curl in PHP
Posted by in PHP code on November 15th, 2010
Here’s how to upload files using curl in php: (it’s very easy)
notice the @ infront of the file path, this is the magic part.
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
curl_setopt($ch, CURLOPT_URL, _VIRUS_SCAN_URL);
curl_setopt($ch, CURLOPT_POST, true);
// same as <input type="file" name="file_box">
$post = array(
"file_box"=>"@/path/to/myfile.jpg",
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
?>
Source: http://dtbaker.com.au/random-bits/uploading-a-file-using-curl-in-php.html
How to run scheduled task using wordpress
Posted by in Wordpress on August 13th, 2009
To run scheduled task you can use UNIX cron facility. It is reliable. But if you want to do it with another way because your hosting does not allow cron job, then you can use wordpress cron by using wordpress plugin. You can use this plugin. After you have installed the plugin, the go to your admin page to set up the task, by entering start time, how often, and the task url.









