<?
$email = stripslashes($email);
$zip = $zip;
$address = stripslashes($address);
$birth = "19" .$year1 .$year2. "-". $month ."-" .$day;
$sex = $sex;
$tel = $tel;
$province = stripslashes($province);
$country = stripslashes($country);
$degree = $degree;
$true_name = stripslashes($true_name);
$pseudonym = stripslashes($pseudonym);
$constellation = $constellation;
$obj_kind = $obj_kind;
$marriage = $marriage;
$body = $body;
$belief = $belief;
$blood_type = $blood_type;
$smoking = $smoking;
$drinking = $drinking;
$height = $height;
$weight = $weight;
$salary = $salary;
$work_area = stripslashes($work_area);
$bp = stripslashes($bp);
$house = stripslashes($house);
$family = stripslashes($family);
$hobby = stripslashes($hobby);
$description = stripslashes($description);
$occupation = $occupation;
$dbl = mysql_connect('localhost','zhaoren','zhaoren');
mysql_select_db('love_me');
$strSQL = "select * from record where id='$user_id'";
$dangan_res = mysql_query($dangan_sql,$dbh);
$dangan_data = mysql_fetch_array($dangan_res);
if ($dangan_data)
{
$strUP = "update record set  ($email, $zip, $address, $birth , $sex, $tel, $province, $country, $degree, $true_name, $pseudonym, $constellation, $obj_kind, $marriage, $body, $belief, $blood_type, $smoking, $drinking, $height, $weight, $salary, $work_area, $bp, $house, $family, $hobby, $description, $occupation)  where id='&user_id'";
}
else
{
$strUP = "insert into record ($email, $zip, $address, $birth , $sex, $tel, $province, $country, $degree, $true_name, $pseudonym, $constellation, $obj_kind, $marriage, $body, $belief, $blood_type, $smoking, $drinking, $height, $weight, $salary, $work_area, $bp, $house, $family, $hobby, $description, $occupation) values('&user_id',)
}
$ph_res = mysql_query($strUP, $dbh);
if ($ph_res)
      { 
       echo '您的修改已经成功!';
       '<a class='content' href=index.html>返回</a>';
    }else
{
echo('
<script>
     window.alert( '修改出错,请检查输入是否有误,谢谢 !!!' )
     history.go(-1)
</script>
');
exit;
}
?>

解决方案 »

  1.   

    最后的<script></script>中的两行语句后都加上分号试试。
    我想使这错了。
      

  2.   

    <?
    $email = stripslashes($email);
    $zip = $zip;
    $address = stripslashes($address);
    $birth = "19" .$year1 .$year2. "-". $month ."-" .$day;
    $sex = $sex;
    $tel = $tel;
    $province = stripslashes($province);
    $country = stripslashes($country);
    $degree = $degree;
    $true_name = stripslashes($true_name);
    $pseudonym = stripslashes($pseudonym);
    $constellation = $constellation;
    $obj_kind = $obj_kind;
    $marriage = $marriage;
    $body = $body;
    $belief = $belief;
    $blood_type = $blood_type;
    $smoking = $smoking;
    $drinking = $drinking;
    $height = $height;
    $weight = $weight;
    $salary = $salary;
    $work_area = stripslashes($work_area);
    $bp = stripslashes($bp);
    $house = stripslashes($house);
    $family = stripslashes($family);
    $hobby = stripslashes($hobby);
    $description = stripslashes($description);
    $occupation = $occupation;
    $dbl = mysql_connect('localhost','zhaoren','zhaoren');
    mysql_select_db('love_me');
    $strSQL = "select * from record where id='$user_id'";
    $dangan_res = mysql_query($dangan_sql,$dbh);
    $dangan_data = mysql_fetch_array($dangan_res);
    if ($dangan_data)
    {
    $strUP = "update record set  ($email, $zip, $address, $birth , $sex, $tel, $province, $country, $degree, $true_name, $pseudonym, $constellation, $obj_kind, $marriage, $body, $belief, $blood_type, $smoking, $drinking, $height, $weight, $salary, $work_area, $bp, $house, $family, $hobby, $description, $occupation)  where id='&user_id'";
    }
    else
    {
    $strUP = "insert into record ($email, $zip, $address, $birth , $sex, $tel, $province, $country, $degree, $true_name, $pseudonym, $constellation, $obj_kind, $marriage, $body, $belief, $blood_type, $smoking, $drinking, $height, $weight, $salary, $work_area, $bp, $house, $family, $hobby, $description, $occupation) values('&user_id',)
    }";
    $ph_res = mysql_query($strUP, $dbh);
    if ($ph_res)
          {
          echo "\'您的修改已经成功!\'
         <a class=\'content\' href=index.html>返回</a>";
        }else
    {
    echo('
    <script lanauage="JavaScript">
        alert( "修改出错,请检查输入是否有误,谢谢 !!!" );
        history.go(-1);
    </script>
    ');
    exit;
    }
    }
    ?>
    建议你用个好的编辑器。
      

  3.   

    <?
    $email = stripslashes($email);
    $zip = $zip;
    $address = stripslashes($address);
    $birth = "19" .$year1 .$year2. "-". $month ."-" .$day;
    $sex = $sex;
    $tel = $tel;
    $province = stripslashes($province);
    $country = stripslashes($country);
    $degree = $degree;
    $true_name = stripslashes($true_name);
    $pseudonym = stripslashes($pseudonym);
    $constellation = $constellation;
    $obj_kind = $obj_kind;
    $marriage = $marriage;
    $body = $body;
    $belief = $belief;
    $blood_type = $blood_type;
    $smoking = $smoking;
    $drinking = $drinking;
    $height = $height;
    $weight = $weight;
    $salary = $salary;
    $work_area = stripslashes($work_area);
    $bp = stripslashes($bp);
    $house = stripslashes($house);
    $family = stripslashes($family);
    $hobby = stripslashes($hobby);
    $description = stripslashes($description);
    $occupation = $occupation;
    $dbl = mysql_connect('localhost','zhaoren','zhaoren');
    mysql_select_db('love_me');
    $strSQL = "select * from record where id='$user_id'";
    $dangan_res = mysql_query($dangan_sql,$dbh);
    $dangan_data = mysql_fetch_array($dangan_res);
    if ($dangan_data)
    {
    $strUP = "update record set  ($email, $zip, $address, $birth , $sex, $tel, $province, $country, $degree, $true_name, $pseudonym, $constellation, $obj_kind, $marriage, $body, $belief, $blood_type, $smoking, $drinking, $height, $weight, $salary, $work_area, $bp, $house, $family, $hobby, $description, $occupation)  where id='&user_id'";
    }
    else
    {
    $strUP = "insert into record ($email, $zip, $address, $birth , $sex, $tel, $province, $country, $degree, $true_name, $pseudonym, $constellation, $obj_kind, $marriage, $body, $belief, $blood_type, $smoking, $drinking, $height, $weight, $salary, $work_area, $bp, $house, $family, $hobby, $description, $occupation) values('&user_id',)
    }";
    $ph_res = mysql_query($strUP, $dbh);
    if ($ph_res)
          {
          echo "\'您的修改已经成功!\'
         <a class=\'content\' href=index.html>返回</a>";
        }else
    {
    echo('
    <script lanauage="JavaScript">
        alert( "修改出错,请检查输入是否有误,谢谢 !!!" );
        history.go(-1);
    </script>
    ');
    exit;
    }
    }
    ?>
    建议你用个好的编辑器。
      

  4.   

    可以用PHPED,我想这个编PHP可能好一些。
    不知道大家喜欢用什么。
      

  5.   

    错误真明显!echo ".....";中怎么能够再用"呢??? echo '您的修改已经成功!';
          '<a class='content' href=index.html>返回</a>';
    你自己看看这两行,第一行后有一个";",那说明echo已经结束了,那第二行是做什么的?你知道,编译器可不知道~~ echo('
                <script>
                    window.alert( '修改出错,请检查输入是否有误,谢谢 !!!' )
                    history.go(-1)
                </script>
                ');再看这里,在“修改出错”前面的"已经把echo语句终止了,编译器现在需要的是一个;号,你却给他一大堆字符,你说编译器能不和你急吗??我都急了~~用良好的编辑器可以一眼看出这样的问题,比如editplus,你要是看见你哪行代码的终止符是桃红色,那就说明你的字符串拼接肯定有问题。我就是用的editplus,所以一眼就看出你的问题来了~~
      

  6.   

    我用的PHPED,一样可以看出来。我主要是讨厌editplus给我的文件备份。可以不要这个功能吗?
      

  7.   

    完全可以~~Document -> Permanent Settings -> Files 
    右下角的四个chekcbox中的第一个就是