They way I handled something like this was, I read the line in with 
fread breaking it up into "$chunks"
        $chunk1 = fread( $fp, 12); //Your string#1
        $chunk2 = fread( $fp, 11); //The URL
        $chunk3 = fread( $fp,  5); //the INT
         $chunk4 = fread( $fp, 50); //The final String
Then when building the next page I would make a link by using this syntax

printf("<td><center><a href=\"%s\">%s</a></center></td>",$chunk1,$Chunk2);


Since you're reading in multiple lines at a time I'd read them into an array
$i=0;
while ( !feof($fp))
        {
        $chunk1[$i] = fread( $fp, 12); //Your string#1
        $chunk2[$i] = fread( $fp, 11); //The URL
        $chunk3[$i] = fread( $fp, 5); //the INT
        $chunk4[$i] = fread( $fp, 50); //The final String       
        global $i;//Since we use $i outside the while make it global
        $i++;
        }
then print from an array
for ($j=0; $j<$i; $j++)
        {
                printf("<td><center><a 
href=\"%s\">%s</a></center></td>",$chunk1[$J],$Chunk2[$J]);
        }




Alain Menard wrote:

> I clicked on the send button to fast...
> 
> The part that i'm having problem with is the second part. Especially the one
> about the first string becomming a link to the corresponding URL.
> 
> 
> ""Alain Menard"" <[EMAIL PROTECTED]> wrote in message
> 9dv3k5$873$[EMAIL PROTECTED]">news:9dv3k5$873$[EMAIL PROTECTED]...
> 
>> Hi!!
>> 
>> I'm presently working on my personal web site and i would like to use PHP
> 
> to
> 
>> do the following :
>> 
>> 1- Read a string in the following format from a text file :
>>      string;url;integer;string
>>      string;url;integer;string
>>      string;url;integer;string
>>                 ...
>>      string;url;integer;string
>> 
>> 
>> 2- Generate a page containing the resulting list in the following format :
>> 
>>               string      integer     string
>>               string      integer     string
>>               string      integer     string
>>                                ...
>>               string      integer     string
>> 
>>       where the first string is a link to the corresponding url.
>> 
>> Any help would be welcome at this point.
>> Thank you in advance...
>> 
>> Alain Menard
>> 
>> 
>> 
>> 
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>> 


-- 

Michael Kelley                  
[EMAIL PROTECTED] 
        
Programmer/Systems Analyst I    
New Mexico State University
Information and Communication Technologies
Work # (505)-646-1374
P.O. Box 30001
MSC: 3AT
Las Cruces, NM 88003






-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to