SnippetMaster Support Forums
Return to main website
 
December 24, 2007, 12:24:43 PM
* Show unread posts since last visit.
* Show new replies to your posts.
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 24, 2007, 12:24:43 PM

Login with username, password and session length
Search:  
Advanced search
* Home Help Search Login Register
SnippetMaster Support Forums  |  General  |  How To's & FAQs  |  Topic: Urgent Help Needed On php Includes « previous next »
Pages: [1] Print
Author Topic: Urgent Help Needed On php Includes  (Read 376 times)
richlewt
Beta Tester

Posts: 18


[-] Urgent Help Needed On php Includes
« on: March 17, 2007, 12:47:11 PM »

Hi
I am going mad Surprised
I have not used this for around 6 months and for some reason can not get a simple test page to work.
Here is my test.php file
<!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=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<?php include(test.txt); ?>
</body>
</html>

and here is my test.txt file
<snippet name="test.txt">
</snippet>

and here is the result of looking at test.php in my web browser
Warning: main(testtxt): failed to open stream: No such file or directory in /home/ngmcc/public_html/test.php on line 8

Warning: main(): Failed opening 'testtxt' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ngmcc/public_html/test.php on line 8

Could someone please point me in the right direction, p.s. I am using Dreamweaver 8.
Report to moderator   Logged

cheers
Rich
Jenkinhill
Beta Tester

Posts: 319



[-] Re: Urgent Help Needed On php Includes
« Reply #1 on: March 17, 2007, 04:10:04 PM »

and here is my test.txt file
<snippet name="test.txt">
</snippet>


That should be
<!-- #BeginSnippet name="test" -->
some content
<!-- #EndSnippet -->

When you look with an ftp client (not DreamWeaver) can you see the text.txt file - does it exist?
« Last Edit: March 17, 2007, 04:17:57 PM by Jenkinhill » Report to moderator   Logged

Kelvyn
richlewt
Beta Tester

Posts: 18


[-] Re: Urgent Help Needed On php Includes
« Reply #2 on: March 17, 2007, 11:51:22 PM »

and here is my test.txt file
<snippet name="test.txt">
</snippet>


That should be
<!-- #BeginSnippet name="test" -->
some content
<!-- #EndSnippet -->

When you look with an ftp client (not DreamWeaver) can you see the text.txt file - does it exist?

Hi
Thanks for reply.
Does not this method mean you are editing the actual test.php file and not the the text.txt file? I wanted to only work with the test.txt files leaving the test.php files alone. I thought the syntax for including a txt file within a php file was along the lines of <p><?php include(test.txt); ?>
Secondly, the test.txt file does exist and can be seen with my ftp client.
Report to moderator   Logged

cheers
Rich
richlewt
Beta Tester

Posts: 18


[-] Re: Urgent Help Needed On php Includes
« Reply #3 on: March 18, 2007, 02:05:51 AM »

Hi
Got is all sorted now. I have noticed that when I use a php include from within Dreamweaver 8 it generates the following:
<?php include(); ?>
it leaves out the quote marks that should be included inside the brackets i.e. <?php include("link to file"); ?>
Put in the quotes and everything is ok Very Happy
Report to moderator   Logged

cheers
Rich
Jenkinhill
Beta Tester

Posts: 319



[-] Re: Urgent Help Needed On php Includes
« Reply #4 on: March 18, 2007, 03:08:49 AM »

Glad you got it sorted. I use DW8, but hand code a lot of stuff, including pHP so I never noticed that it inserted incorrect includes!
Report to moderator   Logged

Kelvyn
Pages: [1] Print 
SnippetMaster Support Forums  |  General  |  How To's & FAQs  |  Topic: Urgent Help Needed On php Includes « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!