mkklepper Posted October 18, 2006 Share Posted October 18, 2006 I have a script that writes link info to a text file, this script reads and displays the information. Everything works bit I get this error msg [b]Notice[/b]:Undefined index: 1 in [b]c:\inetpub\wwwroot\file\path.php on line 44[/b][code]$display = "file\\path.txt";if( is_file($file($display) ) {$fp = @fopen("$display", 'rb'); while( $line = @fgetcsv($fp, 100, "\t") ) { print"<div align=\"center\"><a href=\" $line[1] \"> $line[0] </a></div>"; }}[/code] Quote Link to comment Share on other sites More sharing options...
printf Posted October 18, 2006 Share Posted October 18, 2006 It most likely means that one of the lines in your file does not contain the delimiter -> \t, or the end of your file contains (2) empty lines after the last line with content! fgetcsv(), only allows for a single empty line after the last line with content!Also what is this...[code]if( is_file($file($display) ) {[/code]it should be...[code]if ( is_file ( $display ) {[/code]me! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.