Jump to content

PHP running on IIS


mvosoughi

Recommended Posts

Hi guys,
I already have apache server installed and all my php scripts work just fine. I just registered a domain on a windows paltform server that acutally supports PHP. In my codes I'm using dynamic contents which uses switch fucntion:

if ($page == ""){
$page = 0;
}


$next = $page+1;
$previous = $page-1;

switch ($page)
{
case 0:
$content = "home.htm";

break;
case 1:
$content = "company.htm";

break;

default:
$content = "home.htm";

break;



}

?>


on my index page I use include:

<? include "$content"; ?>

problem: On the windows platform that supports PHP, page can be displayed, but it will but show the content of the different pages, it only shows the contents of page=0.

I change the tag from <? ?> to <?php ?> but nothing happened.

Any idea?
Link to comment
https://forums.phpfreaks.com/topic/3998-php-running-on-iis/
Share on other sites

To call switch code to other pages

[code]
<? include("whatever.php"); ?>
[/code]




Page name whatever.php
[code]
<?
if ($page == ""){
$page = 0;
}


$next = $page+1;
$previous = $page-1;

switch ($page)
{
case 0:
$content = "home.htm";

break;
case 1:
$content = "company.htm";

break;

default:
$content = "home.htm";

break;



}

?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/3998-php-running-on-iis/#findComment-13872
Share on other sites

[!--quoteo(post=351333:date=Mar 3 2006, 02:14 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Mar 3 2006, 02:14 PM) [snapback]351333[/snapback][/div][div class=\'quotemain\'][!--quotec--]
This looks like a register_globals enable vs. disabled problem.

Where is the variable [b]$page[/b] coming from?

Ken
[/quote]

kenrbnsn

It comes from switch statement that is saved on a seperated forlder. First I call that in as

<? include "file.php"; ?> which includes the swtich statement

then the contents of each page will be inserted by
<? include "$contents" ?> that is part of the file.php
Link to comment
https://forums.phpfreaks.com/topic/3998-php-running-on-iis/#findComment-13932
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.