2014-05-11 94 views
0

我在TPL代码:POST不工作正确

<form action="build.php?id={id}" method="post"> 
    <input width="80" type='submit' height='20' value='{uzsakyti_svente}' name='uzsakyti1'> 
    </form> 

当我按下按钮动作时,会自动在行动已经结束页面刷新和Firefox弹出走了出来,让我重新加载页面之间选择取消,现在这是我不希望的问题,当行动完成页面只是刷新,但Firefox表或其他浏览器的表不会出来,现在任何想法如何做到这一点?

+0

你在你的built.php脚本中使用重定向?看起来您的脚本会刷新您的页面,并且通过Post请求,导航器会指示您再次发送数据。 –

+0

是的build.php是我在这种情况下执行操作的相同文件吗? – user3621791

+0

发布您的build.php代码 – Colum

回答

0

重定向到您的网页,如果赶上POST请求,在您的build.php文件:

if (! empty($_POST)) 
{ 
    // Update or insert your data in DB or whatever ... 

    if ($data_ok) 
    { 
     header('HTTP/1.1 303 See Other'); 

     // You can add a param to display in your view that the form was posted 
     header('Location: http://domain.com/build.php?posted=1'); 
     exit(); 
    } 
} 

// Your main code goes here ... 
+0

谢谢你,我会选择这个答案! – user3621791