これが関数です。これはローカルホストで機能しています。しかし、ライブサーバーでは機能しません。
function redirect_to($location = NULL){
if($location != NULL){
header("Location: {$location}");
exit;
}
}
if(mysql_affected_rows() == 1){
//success
redirect_to("index.php");
}