Jump to content

phpinclude() works on internet but not intranet.


Ty44ler

Recommended Posts

I'm setting up a store for our employees on our intranet on sharepoint. All my pages are php and work fine, but php include() does not work. I have taken the folder outside of the network and ran it and it works fine. Here's me code...

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>H.A. Sack Co., Inc. Store</title>
<script type="text/javascript" src="iepngfix_tilebg.js"></script>
<script type="text/javascript" src="scripts/jquery-1.2.1.min.js"></script>
<script type="text/javascript" src="scripts/menu.js"></script>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<style type="text/css">
.ie6_png 			{behavior: url("iepngfix.htc") }
.ie6_png img		{behavior: url("iepngfix.htc") }
.ie6_png input		{behavior: url("iepngfix.htc") }
.style1 {
			font-family: arial;
			font-weight: bold;
			font-size: 12px;
			color: #5A5353;
			text-transform: uppercase;
}
</style>
</head>
<body>
<!-- header //-->
<!-- start -->

<table cellpadding="0" cellspacing="0" border="0" align="center" class="bg_main">
<tr><td class="bg2_main">

	<table cellpadding="0" cellspacing="0" border="0" align="center" class="bg3_main">
		<tr><td>
			<table cellpadding="0" cellspacing="0" border="0">
				<tr><td class="head2">
						 </td></tr>
				<tr><td class="banner"> </td></tr>
			</table>

            </td></tr>
            <tr><td class="cont_padd">           
            
            
<!-- end -->
<!-- start -->



<!-- end --><!-- header_eof //-->

<!-- body //-->
<table border="0" class="main_table" cellspacing="0" cellpadding="0">
<tr>
    <td class="box_width_td_left"><table border="0" class="box_width_left" cellspacing="0" cellpadding="0">
<!-- left_navigation //-->
<!-- categories //-->
          <tr>
            <td>
<table border="0" width="100%" cellspacing="0" cellpadding="0"  class="infoBoxHeading2_table">

  <tr>
    <td  class="infoBoxHeading2_l">
<img src="images/corner_top2_left.gif" border="0" alt="" width="5" height="5"></td>
    <td  class="infoBoxHeading2_td">Categories</td>
    <td  class="infoBoxHeading2_r">
<img src="images/corner_top2_right.gif" border="0" alt="" width="5" height="5"></td>
  </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0"  class="infoBox2_table">
  <tr>
    <td  class="infoBox2_td"><table border="0" width="100%" cellspacing="0" cellpadding="0"  class="infoBoxContents2_table">

  <tr>
    <td  class="box_left2">
<img src="images/box_left2.gif" border="0" alt="" width="5" height="5"></td>
    <td  class="boxText">
	[color=yellow]
	[size=2]<?php include("storenav.php")?>[/size][/color]


    <td  class="box_right2">
<img src="images/box_right2.gif" border="0" alt="" width="5" height="5"></td>
  </tr>
</table>
</td>
  </tr>
</table>
            </td>
          </tr>
<!-- categories_eof //-->
<!-- specials //-->
          <tr>

            <td>
            </td>
          </tr>
<!-- specials_eof //-->
<!-- best_sellers //-->
          <tr>

            <td valign="top">



            </td>
          </tr>
<!-- best_sellers_eof //-->
<!-- left_navigation_eof //-->
    </table></td>

 

 

Link to comment
Share on other sites

When you say it doesn't work what exactly does it do?

 

Does it write the line as text?

 

Does it write the PHP code as text?

 

Does it do nothing at all?  If it does nothing then try looking at your error logs or turning display errors on via your code so you can see what is happening.

Link to comment
Share on other sites

I looked at the source code on the resulting page when on the intranet and the php line still reads: <?php include("storenav.php") ?>

 

It doesn't place the code within storenav.php into the page. There is no error message or anything, nothing shows up where it should be. Nothing shows up within the resulting page where it should be.

Link to comment
Share on other sites

Everything is saved as a php file. The main page works fine. It's all written in html except for the php include piece of code.

 

I assume it is able to run php files as the main page is saved as .php and it shows up fine except for the php include();

Link to comment
Share on other sites

Try running a php file with just the following:

 

<?php
include "storenav.php";
?>

 

and nothing else. Also, turn on all error reporting so that you can see what is going wrong.

 

Dialog box pops up and says what would you like to do with this file open or save?

Link to comment
Share on other sites

If you're getting a dialog box, then you didn't give the test file a ".php" extension. For PHP to work the files must have a ".php" extension or your web server has to be configured to pass all files through the php interpreter.

 

Ken

Link to comment
Share on other sites

I gave the test file a .php extension, the dialog box says what would you like to do with this php file...  Now that you say it, the server may not be configured right. The only reason I say that php works is because because when I open up my index.php page on our intranet it shows up and runs fine. The only thing is that the phpinclude() doesnt work...

 

Here's two screenshots. One is the index.php that is placed on the internet with phpinclude() working properly and the other is the one on the intranet without it working properly. Both files are named index.php.

 

[attachment deleted by admin]

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.