简体   繁体   English

提交表单后刷新页面

[英]Refresh page after form submit

My site allows users to edit it in real time. 我的网站允许用户实时编辑。 I'm having problems on some areas where when you submit the form it doesn't change until I re-launch the page 我在某些区域遇到问题,在这些区域中,当我重新启动页面之前,提交表单不会更改

so it only displays the icons that have text in the DB and when I add a new link in and submit it changes the value in the backend and should change on the front as I relaunch the page with header("Location: admin.php"); 因此,它仅显示数据库中具有文本的图标,并且当我在其中添加新链接并提交它时,它会更改后端的值,并且当我重新启动带有header(“ Location:admin.php” ); (see below) http://snag.gy/lmR8s.jpg (请参见下文) http://snag.gy/lmR8s.jpg

If I press refresh it tries to send the data again. 如果按刷新,它将尝试再次发送数据。 What I have to do is click the url and enter to re-launch the page and the change it made http://snag.gy/vDI90.jpg 我要做的是单击URL并输入以重新启动该页面,并将其更改为http://snag.gy/vDI90.jpg

$submitSocial  = $_POST['submitSocial'];
if(empty($submitSocial)){
    include("includes/social.php");
} else{
    $submitFB = $_POST['fb'];
    $submitTW = $_POST['tw'];
    $submitYT = $_POST['yt'];
    $submitLI = $_POST['li'];
    $submitTL= $_POST['tl'];
    $submitFL= $_POST['fl'];
    $changeSocial = $change->changeSocial($userID, $siteID, $submitFB, $submitTW, $submitYT, $submitLI, $submitTL, $submitFL );
    if($changeSocial){
        include("includes/social.php");
        header("Location: admin.php");
    } else{
        header("Location:  N/A.php");
    }
}

Is there anyway round this as I need it to reload with the things changed first time? 无论如何,我是否需要重新加载第一次更改的内容?

Where is your code that populates the fields initially? 最初填充字段的代码在哪里? Just call this after you save the changes 保存更改后只需调用此

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM