Error in engine

Index.php:

<?php
include('core.php');
$page = $_GET['page'];
switch($page){
  default:
  case '':
  $text = '';
  braek;  
}
include ('style/main.php');
include ('style/register.php');
?>

The error is that when you open main.phpor register.php, these pages merge into one.


Answer 1, authority 100%

<?php
include('core.php');
$page = $_GET['page'];
switch($page){
  default:
  case '':
     include ('style/main.php');
  break;  
   case 'register':
     include ('style/register.php');
  break;
}
?>

Answer 2

UPD

<?
include('core.php');
$page = $_GET['page'];
if(!empty($_GET['page'])) {
    switch($page) {
       case 'main.php' :
           include_once 'style/main.php';
       //     style?O_o
       break;
       case: 'register.php':
           include_once 'style/reigster.php';
       break;
    }
}
else {
    include_once 'style/main.php'; 
}
?>

If I understand correctly, then something like this… In general, would you read about building the site structure …
Ato on the switch looks kinda dumb %)

the code is written correctly, if something still doesn’t work for you, then the problem is not here …