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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.