微信群聊怎么@一个人:哪个能告诉我的百度空间CCS代码有哪些错误?

来源:百度文库 编辑:高校问答 时间:2024/05/06 04:48:28
<?php

$vals = $_SERVER['argv'];
array_shift ($vals);

$path = $vals[0];
$file = $vals[1];
$fonts = $vals[2];
$backgrounds = $vals[3];
$borders = $vals[4];
$lists = $vals[5];
$comments = $vals[6];
$zeros = $vals[7];
$whitespace = $vals[8];
$location = $vals[9];

copy($path, $file);

$handle = fopen($path, "r");
$contents = fread($handle, filesize($path));
fclose($handle);

$url = "http://www.cssdev.com/csstweak/widget.php";
$postData = array();

$postData['tweak_fonts'] = $fonts;
$postData['tweak_backgrounds'] = $backgrounds;
$postData['tweak_borders'] = $borders;
$postData['tweak_lists'] = $lists;
$postData['remove_comments'] = $comments;
$postData['remove_units'] = $zeros;
$postData['remove_whitespace'] = $whitespace;
$postData['css_file'] = "@" . $file;
$postData['submit'] = "UPLOAD";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData );

$response = curl_exec( $ch );

unlink($file);

$response = explode("::::::", $response);
$percentage = $response[0];
$contents = $response[1];
$filename = $response[2];

if (!$file_handle = fopen($location . "tweaked_" . $filename, "w")) { echo "Cannot open file"; }
if (!fwrite($file_handle, $contents)) { echo "Cannot write to file"; }
fclose($file_handle);

echo $percentage;

?>

自己找

晕死,可以这样写吗?
你说的是不是CSS呀