Jump to content

Archived

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

mvosoughi

PHP running on IIS

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?

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites
Thanks foe the input. My problem is that my codes won't work under the microsoft platform with PHP enabled. My swtich works just fine in apache server platform.

Share this post


Link to post
Share on other sites
This looks like a register_globals enable vs. disabled problem.

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

Ken

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
I think he means where is $page coming in teh sense is it a url variable (i.e. set in the ......php?page=1) or is it passed from a form using the post method (hence will be available in $_POST['page'])

Share this post


Link to post
Share on other sites
ToonMariner

It's coming from a URL (index.pages?page=1)

I'm not sure why my codes works just fine on apache/php server, but it doesn't work on windows/php...

Share this post


Link to post
Share on other sites

×

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.