 | |  |
 |

watersidedesign
New User
Jul 4, 2008, 1:37 AM
Post #1 of 3
(539 views)
Shortcut
|
|
New to CMS Builder and need a little help please
|
Can't Post
|
|
Hi All, This is my first time using CMSB and PHP for that matter so I wonder if you could offer a little assistance :) I have used CMSB to create a php file that lists categories. When uploaded to the server this works fine. What I want to do is include this in different files so what I thought I could do was simply use include instead of copying the code into each page. So for example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link href="/style.css" rel="stylesheet" type="text/css"> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="17%"> </td> <td width="83%"> </td> </tr> <tr> <td><?php include("/panels/maincat.php"); ?></td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </body> </html> but all this does is shows a blank page where if i call /panels/maincat.php from the browser, i get my list of categories. Any ideas?
|
|
|  |
 |

Donna
Staff
/ Moderator

Jul 4, 2008, 11:04 AM
Post #2 of 3
(493 views)
Shortcut
|
|
Re: [watersidedesign] New to CMS Builder and need a little help please
[In reply to]
|
Can't Post
|
|
Hi there! PHP actually requires the full server path if you're doing an include. So, /panels/maincat.php likely isn't the right path. It'll probably be something more like /home/username/httpdocs/panels/maincat.php -- check with your hosting provider, and they can tell you the full path to your document root. :) Donna
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

Dave
Staff
/ Moderator

Jul 4, 2008, 11:34 AM
Post #3 of 3
(492 views)
Shortcut
|
|
Re: [watersidedesign] New to CMS Builder and need a little help please
[In reply to]
|
Can't Post
|
|
Or try a relative path that doesn't start with a slash, like this: include("panels/maincat.php"); If it start with a slash you need the entire filepath. Let me know if removing the first / fixed it or not. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
|