Jump to content


Photo

PHP running on IIS


  • Please log in to reply
6 replies to this topic

#1 mvosoughi

mvosoughi
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 03 March 2006 - 11:20 AM

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?


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 03 March 2006 - 11:33 AM

To call switch code to other pages

<? include("whatever.php"); ?>




Page name whatever.php
<?
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;



}

?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 mvosoughi

mvosoughi
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 03 March 2006 - 11:53 AM

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.

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 03 March 2006 - 02:14 PM

This looks like a register_globals enable vs. disabled problem.

Where is the variable $page coming from?

Ken

#5 mvosoughi

mvosoughi
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 03 March 2006 - 03:48 PM

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

Where is the variable $page 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


#6 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 03 March 2006 - 04:02 PM

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'])
follow me on twitter @PHPsycho

#7 mvosoughi

mvosoughi
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 04 March 2006 - 11:04 AM

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






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users