mvosoughi Posted March 3, 2006 Share Posted March 3, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/3998-php-running-on-iis/ Share on other sites More sharing options...
redarrow Posted March 3, 2006 Share Posted March 3, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/3998-php-running-on-iis/#findComment-13872 Share on other sites More sharing options...
mvosoughi Posted March 3, 2006 Author Share Posted March 3, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/3998-php-running-on-iis/#findComment-13874 Share on other sites More sharing options...
kenrbnsn Posted March 3, 2006 Share Posted March 3, 2006 This looks like a register_globals enable vs. disabled problem.Where is the variable [b]$page[/b] coming from?Ken Quote Link to comment https://forums.phpfreaks.com/topic/3998-php-running-on-iis/#findComment-13908 Share on other sites More sharing options...
mvosoughi Posted March 3, 2006 Author Share Posted March 3, 2006 [!--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]kenrbnsnIt 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 Quote Link to comment https://forums.phpfreaks.com/topic/3998-php-running-on-iis/#findComment-13932 Share on other sites More sharing options...
ToonMariner Posted March 3, 2006 Share Posted March 3, 2006 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']) Quote Link to comment https://forums.phpfreaks.com/topic/3998-php-running-on-iis/#findComment-13936 Share on other sites More sharing options...
mvosoughi Posted March 4, 2006 Author Share Posted March 4, 2006 ToonMarinerIt'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... Quote Link to comment https://forums.phpfreaks.com/topic/3998-php-running-on-iis/#findComment-14126 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.