Ask a Question related to PHP Development, Design and Development.
-
Ziggi #1
Loading a file into a DIV
Hi. I want to be able to load some content from a text file straight into a
DIV. Here's the code.
<p class="mainTxt">
<?php
$page = $_SERVER['QUERY_STRING'];
$path = "mystoryfiles/";
$content = file_get_contents($path.$page.'.txt');
echo $content;
?>
Basically, I have a series of files that are accessed via links,
[url]www.somesite.com/somepage.php?content[/url], for example. But, given the filename
content.txt in the directory mystoryfiles, this doesn't seem to work... what
am I doing wrong? Thanks in advance.
Ziggi
Ziggi Guest
-
Loading PDF file
:confused; I've done what Contribute tells me to do about loading a PDF file from my computer. I get the file into the edit box but there is a... -
How to clean file cache before loading PDF file ?
Hi, I have one application in which we open PDF file inside it using the following api . BOOL ok = m_pAcroAVDoc->OpenInWindowEx (pszPathName,... -
loading variables from exe file
i want load some variables from external exe file. my exe generate some variables but i cant load them into flash. have an idea ? -
error loading non-utf-8 XML file
I'm trying to create a rss-reader, which will be used on a dedicated platform. I've got everything up and running, except for one. I need to... -
loading swf file into another one
Hi, What scripts do I use to load a Flash file into another Flash file. Thanks. H -
Nikolai Chuvakhin #2
Re: Loading a file into a DIV
"Ziggi" <one_ziggi@hotmail.com> wrote in message
news:<bkihke$kn6$1@pegasus.csx.cam.ac.uk>...Try this:>
> I want to be able to load some content from a text file straight into a
> DIV. Here's the code.
>
> <p class="mainTxt">
>
> <?php
> $page = $_SERVER['QUERY_STRING'];
> $path = "mystoryfiles/";
> $content = file_get_contents($path.$page.'.txt');
> echo $content;
> ?>
>
> Basically, I have a series of files that are accessed via links,
> [url]www.somesite.com/somepage.php?content[/url], for example. But, given
> the filename content.txt in the directory mystoryfiles, this
> doesn't seem to work... what am I doing wrong?
$page = $_SERVER['QUERY_STRING'];
$path = './mystoryfiles/';
readfile ($path.$page.'.txt');
Obviously, I am assuming /mystoryfiles is a subdirectory of the
current directory. Is this a correct assumption?
Cheers,
NC
Nikolai Chuvakhin Guest



Reply With Quote

