TFD3 Posted April 27, 2008 Share Posted April 27, 2008 Can a PHP script grab a text file from my computer and parse it like it is a URL? Example: <?php $url= "file:///C:/Program%20Files/grlx_eta/cone.txt"; if($content=file_get_contents($url)){ $lines= explode("\n",$content); //Breaks at each new line; $lindex[0] = $lines[113]; $lindex[1] = $lines[114]; $lindex[2] = $lines[115]; }//close of if statement //print_r($lines); foreach($lindex as $value){ echo $value."<br/>"; } ?> Link to comment https://forums.phpfreaks.com/topic/103092-grab-file-from-computer/ Share on other sites More sharing options...
Fadion Posted April 27, 2008 Share Posted April 27, 2008 Abolutely no! What about security then? The only way is let the user upload the file and then proccess it. Link to comment https://forums.phpfreaks.com/topic/103092-grab-file-from-computer/#findComment-528079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.