The header redirect after form submit isn't working and I'd love some help here please (everything else is working fine)...
<?php
require_once "twoauth/autoload.php";
use Abraham\TwitterOAuth\TwitterOAuth;
require("twconfig.php");
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
$status = $_POST['tweetText'];
$filepath = $_POST['uploadedFile'];
$media1 = $connection->upload('media/upload', ['media' => $filepath]);
$parameters = [
'status' => $status,
'media_ids' => implode(',', [$media1->media_id_string])
];
if(isset($_POST['submitTweet'])) {
$post_tweets = $connection->post('statuses/update', $parameters);
header('Location: nextpage.php');
exit();
}
?>
Additional Info: There aren't any errors and it doesn't crash. It just sends off the data and reloads the current form/page. It's a regular form submission, not AJAX. I also tried an inline javascript onsubmit window.location.href call, but that didn't work either. I had a look at the HTTP request/response and cannot see the word "Location" at all. There is "URL" in the summary section and "Referrer" in the request section, but that's it as far as location/URLs go.