代码之家  ›  专栏  ›  技术社区  ›  Kyle

php/smarty中的“ghost”值

  •  0
  • Kyle  · 技术社区  · 15 年前

    我在一个网站上工作了一段时间,改变了webshop结帐流程的布局和外观。我注意到如果你去 一路走来 这个过程直到最后一页,然后点击链接返回到查看产品页面,送货方式价格显示在导航按钮下面,直到您刷新并再次消失。

    我已经从浏览器(chrome,但这个bug适用于所有浏览器)下载了这两个源代码,并使用了 file difference tool 要显示差异,结果仅为:

    < error.html 
    vs
    > normal.html
    34c34
    <   <link href="gzip.php?file=167842c1496093fbcd391b41cf7b03da.css&time=1272272181" rel="Stylesheet" type="text/css"/> 
    ---
    >   <link href="gzip.php?file=167842c1496093fbcd391b41cf7b03da.css&time=1272272348" rel="Stylesheet" type="text/css"/> 
    

    这就是它调整css样式表的方式。(AFAIK)

    有没有人遇到过这样的问题,或者类似的问题?

    正常的: How it is meant to look

    错误: The weird bug

    我根本猜不出是什么引起的。我在谷歌上搜索了一下,什么都没有找到。

    这个源代码中甚至没有任何标记来显示leveringsm_te(delivery method)div。

    这是什么原因?

    有关网站是 Euroworker.no .

    HTML @ Pastebin .

    智能片段:

    {if !$CANONICAL}
            {canonical}{self}{/canonical}
        {/if}
    
        <link rel="canonical" href="{$CANONICAL}" />
    
        <!-- Css includes -->
        {includeCss file="frontend/Frontend.css"}
        {includeCss file="backend/stat.css"}
    
        {if {isRTL}}
            {includeCss file="frontend/FrontendRTL.css"}
        {/if}
    
        {compiledCss glue=true nameMethod=hash}
        <!--[if lt IE 8]>
            <link href="stylesheet/frontend/FrontendIE.css" rel="Stylesheet" type="text/css"/>
            {if $ieCss}
                <link href="{$ieCss}" rel="Stylesheet" type="text/css"/>
            {/if}
        <![endif]-->
    

    谢谢。

    更新 :刚刚使用了dom检查器,发现:

    <TD class="amount shippingAmount">138.-</TD>
    

    在流程的最后一页。为什么会这样?

    更新2

    从firebug的net tab得到的,

    GET order
    
    Response Headersview source
    Date    Mon, 26 Apr 2010 11:20:06 GMT
    Server  Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.10 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g
    X-Powered-By    PHP/5.2.4-2ubuntu5.10
    Expires Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control   no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma  no-cache
    Content-Encoding    gzip
    Content-Length  5244
    Keep-Alive  timeout=15, max=96
    Connection  Keep-Alive
    Content-Type    text/html;charset=utf-8
    Request Headersview source
    Host    www.euroworker.no
    User-Agent  Mozilla/5.0 (Windows; U; Windows NT 6.0; nb-NO; rv:1.9.1.9) Gecko/20100315 Firefox/3.5.9 (.NET CLR 3.5.30729)
    Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language nb,no;q=0.8,nn;q=0.6,en-us;q=0.4,en;q=0.2
    Accept-Encoding gzip,deflate
    Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive  300
    Connection  keep-alive
    Referer http://www.euroworker.no/checkout/pay
    Cookie  PHPSESSID=f5bd84668603decd779c5945d2de045c; __utma=259297566.1176642152.1271066660.1272267705.1272280025.34; __utmz=259297566.1271066660.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=259297566.7.10.1272280025; __utmc=259297566
    

    当我点击HTML上的“获取订单”选项卡时,它似乎是从上一页获取leveringsm_te td,并将其添加到其中。

    1 回复  |  直到 15 年前
        1
  •  1
  •   Pekka    15 年前

    总结以上评论:

    如果神秘的代码行不在html源代码中,而是出现在firebug的dom中,那么很可能是通过ajax注入的。我的猜测可能是某个地方的重置变量不正确,无论是在php还是js端。

    我想没有办法通过逐步调试来找出根本原因。