Josh Naylor
Josh Naylor

Reputation: 273

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"); (see below) 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

$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?

Upvotes: 1

Views: 1259

Answers (1)

Omiron
Omiron

Reputation: 407

Where is your code that populates the fields initially? Just call this after you save the changes

Upvotes: 1

Related Questions