Jump to content

Recommended Posts

Hi, is there any difference between calling pages contents between PHP on Apcahe versus PHP on IIS? My problem is under PHP/Apache I used include command to call in pages contents (index.php?page=2) but under PHP/Windows platform, it cannot pass the page contents or page title and it only calls the page=0 contents.

As I said, my codes works under PHP/Apache and I have no problem calling in the contents of each page using switch statement ...

Any ideas how to solve this problem?

Here is a sample of my codes:
----------------
index.php
---

<?
include "contents.php";
?>

<?
include "pages/$content";
?>
-----------------
contents.php
---
<?
switch ($page)
{
case 0:
$content = "main.php";
$title = "Main";
break;

case 1:
$content = "page2.php";
$title = "Page two";
break;
?>
Link to comment
https://forums.phpfreaks.com/topic/4315-phpapache-vs-phpwindows-iis/
Share on other sites

That depends on how you pass the variables to your page. Is $page supposed to be something like index.php?page=0? If this is the case I would suggest using $_GET['page'] because your server may not be configured to use $page. It is safer that way and it is a better coding practice to go for a universal compatibility. Additionally, if you are interested, I could make suggestions on ways to possibily simplify your script. Only if you are interested in my help.

Happy coding!

P.S.

You can install Apache on windows platforms. I personally prefer working with Apache.
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.