<?php if(!empty($rs['series'])){ 
$parm="brand=$rs['code']";
header("location: url?$parm"); 
exit; 

?>

解决方案 »

  1.   


    Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\EasyPHP\www\watcheslist.php on line 48
      

  2.   

    代码看起来没问题,再用header("location:你的url?brand=".$rs['code'].")"; 这个试试,再不行就只好用session传值了,呵呵
      

  3.   

    用 pear 的 HTTP_Request 类
      

  4.   


    if(!empty($rs['series'])){ 
    $array=array('brand'=>$rs['series']);
    $parm=http_build_query($array);
    header("Location: ?$parm");
    exit();

      

  5.   


    不报错了.但是没效果..
    我把这一行$array=array('brand'=>$rs['series']
    改成了$array=array('brand'=>$rs['brand']因为我想传的是brand这个值.但是两种都没效果.传递不了值.
    在地址栏只看到:http://localhost/watcheslist.php? 后面没值.
      

  6.   

    把rs['brand']打印出来看看有没有值.
      

  7.   

    刚才搞错了.现在可以看到http://localhost/watcheslist.php?brand后面有值了.
    但知道为什么很慢.停在原来的页面.但在浏览器下面的状态栏看到http://localhost/watcheslist.php?brand=zhuhai 
    但是就是不能打开.
      

  8.   

    如果在firefox打开就显示:"此页面重定向不正确
    Firefox 检测到该服务器正在将此地址的请求循环重定向。
    * 此问题可能是因为禁用或拒绝 Cookie 导致。"        
           
          
      

  9.   

    现在用了下面的办法成功了.
    <?php if(!empty($row_rs['series'])){?>
    <meta http-equiv="refresh" content="0;url=series.php?brand=<?php echo $row_rs['brand']; ?>">
    <?php exit;
    }?>很感谢各位.再研究一下dada20042030兄的代码.
      

  10.   

    你不能重定向同一个URL,除非你只运行一次.要不然会出现类似死循环的.
      

  11.   

    header("location: ?brand=$rs['code']"); 错误原因是你根本就没给出合法的URL