script error

i use a lil' script on the site im working on, i have this in a css div table

<?
if($s=="gallery"){
include "gallery.html";
}
if($s=="about"){
include "about.html";
}
if($s=="contact"){
include "contact.html";
}
else{
include "news.php";
}
?>

If i use the link index.php?s=gallery then i see the content of gallery.html PLUS the content of news.php

hehe well, thats logical cuz it says if(contact) :else: ..., so the ?s=contact doesnt give two pages, am i right? ;)
here's is what I would do:

<?
if(!isset($_GET['s']) OR $_GET['s'] == NULL)
{
include ('news.php');
}
else if($_GET['s'] == 'gallery')
{
include ('gallery.html');
}
else if($_GET['s'] == 'about')
{
include ('about.html');
}
else if($_GET['s'] == 'contact')
{
include ('contact.html');
}
else
{
print ('404 Page not found!');
//include ('news.php');
}
?>

and its working ty :)

explanation: $_GET is a superglobal, used to kill security issues, and to make the code look better :) In PHP5 the use of this / or not, isnt a option anymore ;).
I placed the standard page: news to the beginning cuz PHP will find the most loaded page faster.
The choise is to you if you want a 404 if the s doesnt excist or the news page ...

also replaced "" with '', because there are no vars in it, also faster ;)
include is a function! so using () is adviced.

just to be sure don't use <? but use <?php, because not all servers allow <? (in php.ini)

also you could just create a simple function like thi:

<?php
$direc = '/path/to/where/the/files/are/';
$check = 's'; // ?HERE YOU CHOOSE THIS=bla
$exten = 'php'; // the page extension that the page has (that we need to include)...
if (isset ($_GET[ $check ]) && !empty ($_GET[ $check ])) // check if $check var is set in the url
{
$file = $direc . $_GET[ $check ] . '.' . $exten; // set the file name
if (file_exists ($file) === true) // check if the file exists
{
include ($file); // include the file
}
else
{
die ('Error: #404: File Does Not Exists!');
}
}
?>