|
Author |
Message |
fgidigi
Junior WebHelper
Joined: 07 Sep 2003
Posts: 16
|
Posted:
Sun Sep 07, 2003 12:50 pm (20 years, 7 months ago) |
|
Hi there,
I'm a newbee, I don't know much about php, so i am learning the basics. I got my 'hello world' test working.
Now I wanna display (echo) the contents of another file {for instance a text file, php or htm - file} into let's say the middle of an excisting htm file, using php.
I tried the test with 'inc' [which i read in the tutorial] but did not succeed.
can someone help me out?
thank you / Figidigi |
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Sun Sep 07, 2003 1:24 pm (20 years, 7 months ago) |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Sep 07, 2003 1:47 pm (20 years, 7 months ago) |
|
You'll have to rename your .html file to something.php, and then put this code where you want to echo the other file:
Code: | <?php include ('name_of_other_file.php_or_html_or_whatever'); ?> |
|
________________________________
|
|
|
|
SfCommand
Senior WebHelper
Joined: 10 Nov 2002
Posts: 143
Location: UK
|
Posted:
Sun Sep 07, 2003 2:01 pm (20 years, 7 months ago) |
|
|
|
|
fgidigi
Junior WebHelper
Joined: 07 Sep 2003
Posts: 16
|
Posted:
Sun Sep 07, 2003 2:24 pm (20 years, 7 months ago) |
|
Daniel...
* sigh * i've been trying so long and hard before I used your forum and I felt like a moron for not succeeding.
The thing was ... i kept using the HTM file as a basis.
because manuals told me it was INBEDDED in htm, so I named mine test.htm.
In that test - file I tried to put the php script ... WRONG, me silly cow.
your first phrase was essential! I had to rename the extension into php
then it would work...
I am really really really happy - finally I see some php results.
Great and thanx for writing so clearly.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
figidigi |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Sep 07, 2003 2:27 pm (20 years, 7 months ago) |
|
Hey, I know what it feels like to spend hours working on a problem only to find out something simple is wrong. You feel like banging your head against a brick wall |
________________________________
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.218511 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |