How to insert php 'include' on homepage.php

7 posts by 3 authors in: Forums > CMS Builder
Last Post: August 21, 2008   (RSS)

By webfoot - August 20, 2008

On my home page I would like to insert a server side include to call up articleList.php. I have articleList.php in the same directory as my home page. I have used this; <?php include("articleList.php"); ?> but the list is not showing up.

Also, I think Dreamweaver may be rewriting or deleting some of the code even though I have fixed this in the preferences.

Guess I am missing something and would appreciate your help!

Thanks,
melinda
webfootstudios.com

Re: [webfoot] How to insert php 'include' on homepage.php

By Dave - August 20, 2008

Hi Melinda,

Is any html from the articleList.php showing up? Or nothing at all? And are there any errors?

If you can attach your homepage file I can take a look at the code and let you know if I see any code that may have been deleted or rewritten by dreamweaver that is causing a problem.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] How to insert php 'include' on homepage.php

By webfoot - August 20, 2008

Dave,

I have just started on this site but here is url;
http://www.infinitewell-being.com/indexa.php and articleList.php is located in root also.

This is the error message on homepage:

Warning: main(,articleList.php): failed to open stream: No such file or directory in/hermes/web01/b1420/as.wellbeing/public_html/indexa.php on line 105

Warning: main(): Failed opening ',articleList.php' for inclusion(include_path='/hermes/web01/b1420/as.wellbeing/public_html/cmsAdmin:.:/usr/local/lib/php-4.4.7/lib/php') in/hermes/web01/b1420/as.wellbeing/public_html/indexa.php on line 105

I am not familiar with php so am hoping this is an ez fix. I have 3 articles in admin and list url is articleList.php.

Also, does this stay on the articleList.php page?
<hr/>
<?php endforeach; ?>

<?php if (!$articles_1st_colRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
<!-- /STEP2: Display Records -->

And also where on page does this belong - above? <!DOCTYPE or in head?

<?php

require_once "/hermes/web01/b1420/as.wellbeing/public_html/cmsAdmin/lib/viewer_functions.php";

list($articles_1st_colRecords, $articles_1st_colMetaData) = getRecords(array(
'tableName' => 'articles_1st_col',
'allowSearch' => '0',
));

?>


:-)
Thanks for helping me get started with CMSBuilder,
melinda
webfootstudios.com

Re: [webfoot] How to insert php 'include' on homepage.php

By Dave - August 21, 2008

Hi Melinda,

Yes, I think it may be the comma as well. Can you attach indexa.php to your post or send me FTP details to dave@interactivetools.com (email, don't post FTP details to the forum) and I can take a look and post back here?

Let me know how I can best help.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] How to insert php 'include' on homepage.php

By webfoot - August 21, 2008

Hello..

Yes I removed the coma. Here is online link;
http://www.infinitewell-being.com/indexa.php
still an error message.

I am also uploading indexa.php

Pls. watch for email with FTP details.

Many thanks....
melinda
webfootstudios.com
Attachments:

indexa.php 8K

Re: [webfoot] How to insert php 'include' on homepage.php

By webfoot - August 21, 2008

FYI - to tie things up-

At Dave's suggestion, by email, I corrected my php code directly on server and it turns out my html editor software was the culprit and was modifying the php tags. All is working now.

Thanks Dave!
melinda
webfootstudios.com