Jump to content


Photo

Include file problems.. Pls. Help


  • Please log in to reply
2 replies to this topic

#1 teramera

teramera
  • Members
  • PipPip
  • Member
  • 25 posts

Posted 23 May 2006 - 09:26 PM

Hi!,
I translated an usual HTML page into PHP and inserted the Include file tag but the include file does not show.
When i test the include file on its own .. it works.
I am certain I have something wrong in the syntax .. or the way the code is presented.
Please take a look at the code below and help.

The code that i tried to include is : <?php include("http://mysitename.co...om/banners.php"); ?>

The code which is not working is:
echo "                <div align=\"center\">\n";
echo "                  <center>\n";
echo "        <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"160\" style=\"border-collapse: collapse\" bordercolor=\"#111111\">\n";
echo "          <tbody><tr> \n";
echo "            <td> \n";
[color=#CC0000]echo "  <p align=\"center\"><?php include(\"http://www.mydomainname.com/banners.php\"); ?></td>\n";[/color]
echo "          </tr>\n";
echo "        </tbody></table>\n";
echo "                  </center>\n";
echo "                </div>\n";
echo "                <p>\n";
echo "        <br>\n";

Please help am going nutty with this as a newbie.
Thanks in advance.
Regards
tera

#2 mjozwiak

mjozwiak
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 24 May 2006 - 12:11 AM

Hell,

First of all, you dont want to use echo like that
<?php 
$include = include('http://www.mydomainname.com/banners.php'); //should be an .inc file
?>
<html>
<head>
<title></title>
</head>
<body>
<table>
<tr>
<td><?php echo $include;?></td>//or the code below
</tr>
</table>
</body>
</html>

<td><?php include('http://www.mydomainname.com/banners.php'); ?></td>

Play around with it and you should make the banners.php local and name it banners.inc

Hope to help!

Matt

#3 kenrbnsn

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

Posted 24 May 2006 - 01:53 AM

Do not use the full URL in your include statement. Since it looks like you're including a local file, just use the local path.

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users