<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script language="javascript">
function mm(s){
var=str;
str=s.substr(str.lastIndexOf(".")+1,3);
return str;}
</script>
<body>
<?
$str="C:\Documents and Settings\Administrator\桌面\1.jpg";
echo mm($str);
?>
</body>
</html>
怎么总出现Fatal error: Call to undefined function mm() 错误::请大家指教>>>>>谢谢.....
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script language="javascript">
function mm(s){
var=str;
str=s.substr(str.lastIndexOf(".")+1,3);
return str;}
</script>
<body>
<?
$str="C:\Documents and Settings\Administrator\桌面\1.jpg";
echo mm($str);
?>
</body>
</html>
怎么总出现Fatal error: Call to undefined function mm() 错误::请大家指教>>>>>谢谢.....
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档 </title>
</head>
<script language="javascript">
function mm(s)
{
var str=s.substr(str.lastIndexOf(".")+1,3);
return str;
}
</script>
<body>
<?
echo "<script language='JavaScript'>mm('C:\Documents and Settings\Administrator\桌面\1.jpg');</script>";
?>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档 </title>
</head>
<script language="javascript">
function mm(s){
var=str;
str=s.substr(str.lastIndexOf(".")+1,3);
return str; }
</script>
<body>
<?
$str="C:\Documents and Settings\Administrator\桌面\1.jpg";
echo "<script>"; //注意这里
echo mm($str);
echo "</script>";?>
</body>
</html>
楼主:这是php是做什么的问题. php做的是将服务器端的数据render 成数据发送到客户端. 所以,当时报错时,你应该关注一下源代码. 这个是明显的少了一个js的环境.<script></script>