【发布时间】:2013-12-28 10:42:06
【问题描述】:
我正在使用 Flash 和 PHP 创建 JPG。我的本地服务器上的 Flash 和 PHP 按预期工作。当我上传到服务器时,我收到以下错误:
解析错误:语法错误,意外的 ':' in /home/carlosrg/public_html/mysubdomain/image.php上线 6
还有代码:
<?PHP
date_default_timezone_set('America/Los_Angeles');
$targetFilename = date(‘YmdHis’).’_’.mt_rand().’.jpg’;
$serverpath = ‘http://www.mysubdomain.myserver.com';
$directoryPath = ‘/newimagesfolder/‘;
$target_path = $_SERVER['DOCUMENT_ROOT'].$directoryPath.$targetFilename;
if ( move_uploaded_file( $_FILES[ 'userfile' ][ 'tmp_name' ], $target_path ) )
{
echo $serverpath.$directoryPath.$targetFilename;
}
else
{
echo "error";
}
?>
提前感谢您的宝贵时间。
【问题讨论】:
-
您似乎使用了奇怪的撇号。您需要使用
',而不是‘- 那些来自Word? -
弯引号; 美丽却致命。
标签: php actionscript