Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Text won't display from my "include"

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Text won't display from my "include"

Postby kennyharrill » Mon Apr 08, 2013 12:48 pm

Below is the php code from an email file I'm working with. When I go to my website, the file that is supposed to be in "include" (rather text) does not display:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Southern Heritage 411</title>
<link rel="stylesheet" href="StyleSheet1.css">
</head>
<body bgcolor="#006400">
<script language="javascript">
<!--
function DisplayMenu (stobj,stbullet)
{
var obj = document.getElementByID(stobj);
var bullet = document.getElementByID(stbullet);
if(obj.ClassName == "submenu_hide")
{
obj.className = "submenu_show";
bullet.src = "images/menubullet_up.gif";
}
else
{
obj.className = "submenu_hide";
bullet.src = "images/menubullet_down.gif";
}
}
function testit ()
{
}
//-->
</script>
<center>
<table class="maintable" id="Table1" cellspacing="0" cellpadding="0" border="0" width="752">
<tr>
<td colspan="2">
<div class="pageheader">
<table width="752" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right">
<img src="titlebar2.jpg">
</td>
<td align="right" valign="middle">
<img src="confederate_flags3.jpg">
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<? include "virtual_menu.shtml"; ?>
<td bgcolor="#ffffff" valign="top" align="left" width="80%">
<!-- Information Section -->
<!-- *** Interesting E-Mail Begins Here *** -->

<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="emails.shtml">Back to the main e-mails page.</a>
<br><br>

<?
$mlno = "emails/$ml.php";
include "$mlno";
?>


<!-- *** End *** -->
<!-- Information Section Ends -->
</td>
</body>
</html>

I have recently switched operating systems from Windows 7 to 8. I had used Dreamweaver for html editing, but had downloaded Microsoft Sharepoint to use when I got Windows 8. I managed to get Dreamweaver loaded and am using that. When I click on any of my .php files, only a link to return to my .shtml page appears, and not the text that is supposed to. Any help appreciated. This is baffling!
kennyharrill
New php-forum User
New php-forum User
 
Posts: 9
Joined: Mon Apr 08, 2013 12:38 pm

Re: Text won't display from my "include"

Postby seandisanti » Mon Apr 08, 2013 3:57 pm

are you getting an error? also, you're using short open tags (or asp tags), <? instead of <?php make sure you have them enabled on your server or that could be causing your error right there.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: Text won't display from my "include"

Postby kennyharrill » Mon Apr 08, 2013 6:06 pm

<?php
$mlno = "emails/$ml.php";
include "$mlno";
?>

I changed the first line to <?php. $mlno is a named variable - "ml" is a number for a specific file in the emails directory. But when I click on a link to show any particular php file in the emails directory, all it shows is the message at the top of the page, Back to the main e-mails page. It's not showing the text file that's supposed to be included. I am wondering if this is a Windows 8/Sharepoint issue, being that I switched recently from Windows 7 to 8 and used Sharepoint instead of my normal dreamweaver. It's really baffling and I'm eager to get this issue corrected. Any help appreciated.
kennyharrill
New php-forum User
New php-forum User
 
Posts: 9
Joined: Mon Apr 08, 2013 12:38 pm

Re: Text won't display from my "include"

Postby seandisanti » Mon Apr 08, 2013 8:36 pm

what do you have listed in the file being included?
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: Text won't display from my "include"

Postby kennyharrill » Tue Apr 09, 2013 3:03 am

An example file is 123.php. The individual php files in this case have just text, an article, shared e-mail, etc.
kennyharrill
New php-forum User
New php-forum User
 
Posts: 9
Joined: Mon Apr 08, 2013 12:38 pm

Re: Text won't display from my "include"

Postby seandisanti » Tue Apr 09, 2013 9:35 pm

giving the name of a file on your computer that noone else can see may not be helping your cause as much as you'd hoped... can you do a check with phpinfo() to verify your php version, and include a sample of the contents of the file, specifically tags in use, etc. Have you tried using a php extension?
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron