http://support.microsoft.com/kb/322756/
1 / 2| 次のページ »
ID:1222680708
ID:1222679300
ID:1222674677
umask(0); //umask値を0に設定する スクリプトの実行が終わると元の値に戻ります mkdir(strDirName,intPermission); //作成。
ID:1222396106
if ($dh = opendir($dirName)) { while ($entry = readdir($dh)) { if (is_dir($entry) && $entry != "." && $entry != ".." ) { echo $entry."http://sb.xrea.com/archive/index.php/t-11861.html
"; } } closedir($dh); }
ID:1222244055
ID:1222240432
ID:1221625722
$curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $receiveData = curl_exec($curl); curl_close($curl);
ID:1221615460
ID:1221613755
$ch=curl_init(); curl_setopt ($ch,CURLOPT_URL,"https://example.com/"); curl_setopt ($ch,CURLOPT_POST,1); //postするデータ $post = "user_id=001&price=105"; curl_setopt ($ch,CURLOPT_POSTFIELDS,$post); curl_setopt ($ch,CURLOPT_SSL_VERIFYPEER,FALSE); curl_setopt ($ch,CURLOPT_RETURNTRANSFER, 1); var_dump(curl_exec($ch)); curl_close ($ch);
ID:1220950218
function do_get($url) { $res = get_contents($url); $res_array = explode("\r\n", $res); switch ($res_array[0]) { // とりあえず必要なコードのみ。 case 'HTTP/1.0 200 OK': case 'HTTP/1.1 200 OK': // ボディを取り出す。 $ra = explode("\r\n\r\n", $res, 2); $res = $ra[1]; break; case 'HTTP/1.1 302 MovedTemporarily': // 移動先URLを取り出す。 foreach ($res_array as $res_row) { if (strstr($res_row, 'Location: ')) { $crr_url = str_replace('Location: ', '', $res_row); break; } } $res = get_contents($crr_url); // ボディを取り出す。 $ra = explode("\r\n\r\n", $res, 2); $res = $ra[1]; break; default: $res = ''; } return $res; } function get_contents($url) { // ホストとポートを取得する。 $url_array = parse_url($url); $host = $url_array['host']; $path = $url_array['path']; if (array_key_exists('port', $url_array)) { $port = $url_array['port']; } else { switch ($url_array['scheme']) { case 'http': $port = 80; break; } } $query = $url_array['query']; $res = false; if (isset($host) && isset($port)) { $fp = fsockopen($host, $port, $errno, $errstr, 30); if ($fp) { $req = "GET " . $path . "?" . $query . " HTTP/1.0\r\n" . "Host: " . $host . "\r\n" . "\r\n"; socket_set_timeout($fp, 10); if (fputs($fp, $req, strlen($req))) { $res = ''; while (!feof($fp)) { $res .= fgets($fp); } } fclose($fp); } } return $res; }http://saikyoline.jp/weblog/2007/02/file_get_contents_1.html
最近のコメント