I am very new to php, but I am trying to use the following code to import data from a txt file that is saved on my server:
<?php
$filename="totals.txt";
$handle=fopen($filename,"r");
$contents=fread
($handle,filesize($filename));
echo($contents);
?>
The problem is that code imports the whole file- is there any way to import only part of the file? Say the last part of the first line? The txt file is generated by a form on my website and the form is automatically placing the persons ip address and I don't want that to show on our site.
Or maybe I'm just going about this the wrong way and there is a form you can use in php to allow the visitor to your site to post to a certain page on your site?
Any help or direction you could provide would be appreciated! As I mentioned, I'm very new at this, but I would like to learn!