I know this has been asked a million times, but I've gone through all the answers to no avail, and as I only have a small amount of code, I figured it's a relatively simple fix (I hope). The frustrating thing is, is that php file works perfectly on one server, but not on another.
I'm receiving this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/thepcguy/public_html/ship_image/functions/function-redirect.php:1) in /home/thepcguy/public_html/ship_image/functions/function-redirect.php on line 9
relating to this file
<?php require_once('../Connections/ships.php');
if ($_GET['shore'] == "1") {
header('Location: ../shore_establishment.php?ship_id=' .urlencode($_GET['ship_id']) . "&shore=1" . "&page=ship");
//echo"first";
} else if ($_GET['shore'] == "0") {
header('Location: ../shipinfo.php?ship_id=' .urlencode($_GET['ship_id']). "&shore=0" . "&page=ship");
//echo"second";
};
?>
For interests sake, the file ships.php is:
<?php
$hostname_ships = "xxxxx";
$database_ships = "xxxxx";
$username_ships = "xxxxx";
$password_ships = "xxxxx";
$ships = mysql_pconnect($hostname_ships, $username_ships, $password_ships);
?>