Page 1 of 1

Php/Html include

Posted: Wed Sep 11, 2013 7:06 pm
by Martin
Hi i'm making a page where my classmates can go and check what food is served in the school cafeteria.
The page first had a javascript that read from a textfile and made a table from the stuff in it, but it did not use utf-8 so some words looked strange. So i changed to php but then i got problems with the include part because my version of xampp didn't let me use
Code: Select all
<?php include("convertintotab.php"); ?>
So then i changed the page to a .php file so it was able to use the include part. But i'm still having problems with some words not showing right.

Please help me if you can /Martin.
Desktop.rar

Re: Php/Html include

Posted: Wed Sep 11, 2013 7:37 pm
by Filip
Well I'm missing convertintotab.php

Re: Php/Html include

Posted: Wed Sep 11, 2013 7:50 pm
by Martin
Oh forgot to add it to the archive.
convertintotab.rar

Re: Php/Html include

Posted: Wed Sep 11, 2013 7:57 pm
by Martin
A friend helped me out, the problem was that the textfile was not in utf-8 :S

Re: Php/Html include

Posted: Wed Sep 11, 2013 11:43 pm
by zachman61
What PHP version are you on that you're using include(FILENAME)?

Re: Php/Html include

Posted: Thu Sep 12, 2013 4:47 am
by visualtech
if the "include" header is in the directory with the main (host) script. Add this before the include keyword.
Code: Select all
set_include_path("./"); // Or specify the folder after the / in the path.
include("myfile.php");

Re: Php/Html include

Posted: Thu Sep 12, 2013 5:20 am
by Filip
Martin wrote:
A friend helped me out, the problem was that the textfile was not in utf-8 :S
The problem was solved lol