Jump to content

Recommended Posts

I have my main page set up as html. I am using php to pull in a text file. I can (on its own) read a text file but when i add the php code to the html it does not work. Help please.

 

<?php

 

/**

*

*

*

 

@version $Id$

*

 

@copyright 2014

*/

// Read 14 characters starting from the 21st character

//$section = file_get_contents('./people.txt', NULL, NULL, 20, 14);

//$section = file_get_contents('C:/users/jneely/desktop/test.txt', true);

//$section = file_get_contents('\\s-dmf\data\M200\TM-0731\FunctionTest\Archive\14011623595241162401B.txt', true);

$section

 

= file_get_contents('//s-fs2/attachments/test.txt', true);

//var_dump($section);

echo(

$section);

 

?>

 

My html.....

 

$rightcolumn

 

= <<< EOF

<a href="http://example1.com/">QPR</a>

<br/><a href="http://example2.com/">Deviation</a>

<br/><a href="http://example3.com/">Boundary Samples</a>

<br/><a href="http://example4.com/">TPC</a>

<br/><a href="http:readtextfile.php">Test</a>

<br/><a href="http://example6.com/">Link 6</a>

EOF

 

 

;

 

Link to comment
https://forums.phpfreaks.com/topic/285640-read-a-text-file-into-my-web-page/
Share on other sites

What exactly do you expect your anchor tag for readtextfile.php to do? If you want it to load that PHP file, you need to fix the href to actually point to that file, right now it's pointing to some non-existent http:readtextfile.php.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.