Reply to php include problem

Your name:

Reply:


Posted by Heikki on 08/16/07 15:06

first. sory about bad english.

my index.php has link-menu in a right side, that opens something.php
next to the menu.

something.php has a link link-menu at the top of the page that should
open stuff.php under this last menu.

the broblem is that stuff.php opens to the place of something.php. so
the top link-menu disapears.

I think this is a conflict between index.php and something.php, but I
don t know how to fix it...

code in index.php:

<?php
$sivut = array('something');

if (in_array($_GET['sivu'], $sivut)) {
include ($_GET['sivu'] . '.php');
}

else
{
include('error.php');
}

?>

<a href="index.php?sivu=something">something</a><br>

this works good....
code in something.php:

<?php
$sivut = array('stuff','stuff2');

if (in_array($_GET['sivu'], $sivut)) {
include ($_GET['sivu'] . '.php');
}

else
{
include('error.php');
}

?>

<a href="index.php?sivu=stuff">stuff</a>
<a href="index.php?sivu=stuff2">stuff2</a>

so is it about these $sivut or['sivu'] codes. I tried to change those
but didn t help.

and how to define what page opens first?
whitout klickings....
should be something like this:

if ($sivu ==""){
$sivu = "firstpage";

how do I put it there

thanks

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация