Warning: Undefined array key "HTTP_ACCEPT_LANGUAGE" in /var/www/minitokyo/www/includes/common.inc.php on line 360 html combined with php include - any good alternative? - Minitokyo

html combined with php include - any good alternative?

page 1 of 1 8 total items

I have a html site and to display the content I use a php include. That means, if you klick on the links the content will appear in the area that is set up with the include (see below).
Well, after changing my webspace provider this system does not work anymore. Does anyone know a method how to display the content anyway without changing the other files (file.php)? You know, I have too many files to rewrite them and make them compatible with the system. So the files must stay and the links must remain like this:

Code:
index.php?site=file

Code:
(...)
if (!isset($site)) { $site="start"; }
if (file_exists($site.".php")) { include($site.".php"); } else { echo " <b><center></center></b> "; }
?>

Would be great if someone could help.

Instead of using if/else statements, use a switch statement. Heres a link to a tutorial writting on the subject: http://xangelo.com/tutorials.php?tid=7

Thank you for your support but I tried it out and got the following thing:

parse error, unexpected T_STRING

Unfortunately it doesn't seem to work. I adjusted home.php in the code to start.php like I needed it and id to site.

I suggest you look to a more tech savvy forum then MT for help on PHP. I can't really help you since I know next to nothing about PHP, but Neowin members will be easily able to help you. ^^

yamazaki

yamazaki

what the ??

ok, first the code you provide is not secure at all. dont ever include a file by passing the variable from url.
you can try using switch instead
[code]
<?php

$site = $_GET["site"];

switch($site)
{
case 'about':
include "about.php";
break;

case 'works':
include "works.php";
break;

default:
include "index.php";
break;
}
?>
[/php]

let me know if you need any help

Signature
	Image

signature by: k1ru ^_~ thanks alot girl
thanks to k1ru for the signature ^_~

xshintax

Gif files are Compu$erve

I don't think I understand. Is it because your new host doesn't have PHP? If that's the case use SSI maybe... Or ASP if you are using Windows (server)...

Wtf is your problem?!?

Why the f*** do I need to use proprietary filetypes in my signature and avatar? Stupid Minitokyo... STUPID COMPU$ERVE! Use png instead.

yamazaki

yamazaki

what the ??

if his new host doesnt support php, then he wouldnt even get this error in the first place

parse error, unexpected T_STRING

Signature
	Image

signature by: k1ru ^_~ thanks alot girl
thanks to k1ru for the signature ^_~

xshintax

Gif files are Compu$erve

Oh yeah, XP.

Wtf is your problem?!?

Why the f*** do I need to use proprietary filetypes in my signature and avatar? Stupid Minitokyo... STUPID COMPU$ERVE! Use png instead.

page 1 of 1 8 total items

Back to Computers & Internet | Active Threads | Forum Index

Only members can post replies, please register.

Warning: Undefined array key "cookienotice" in /var/www/minitokyo/www/html2/footer.html on line 73
This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read more.