text file and text box script 
Author Message
 text file and text box script

Hi.

I have a .txt file with 3 lines of text.

I have 3 text box too.

I want that when i open a php page it reads the file .txt and in the text
box 1 writing the line 1 of the file text, in the text box 2 writing the
line 2 of the file text .....

Its possible? What can i do?

Thank you
Regards
Joca



Sun, 30 Oct 2005 20:42:25 GMT  
 text file and text box script

Quote:

> Hi.

> I have a .txt file with 3 lines of text.

> I have 3 text box too.

> I want that when i open a php page it reads the file .txt and in the text
> box 1 writing the line 1 of the file text, in the text box 2 writing the
> line 2 of the file text .....

> Its possible? What can i do?

> Thank you
> Regards
> Joca

<?php
     $filename=dirname(__FILE__).'/filttoread.txt';
     $contents=file($filename);
     echo '<textarea name="text1">',$contents[0],'</textarea>',
         '<textarea name="text2">',$contents[1],'</textarea>',
         '<textarea name="text3">',$contents[2],'</textarea>';
?>

--

PHP POSTERS: Please use comp.lang.php for PHP related questions,
              alt.php* groups are not recommended.



Sun, 30 Oct 2005 20:53:58 GMT  
 text file and text box script
Thank you. But the .txt file isnt in the server web php. The .txt file is
in the computer local which its seeing the php web.

Its possible?

Regards.
Joca



Quote:

> > Hi.

> > I have a .txt file with 3 lines of text.

> > I have 3 text box too.

> > I want that when i open a php page it reads the file .txt and in the
text
> > box 1 writing the line 1 of the file text, in the text box 2 writing the
> > line 2 of the file text .....

> > Its possible? What can i do?

> > Thank you
> > Regards
> > Joca

> <?php
>      $filename=dirname(__FILE__).'/filttoread.txt';
>      $contents=file($filename);
>      echo '<textarea name="text1">',$contents[0],'</textarea>',
>          '<textarea name="text2">',$contents[1],'</textarea>',
>          '<textarea name="text3">',$contents[2],'</textarea>';
> ?>

> --

> PHP POSTERS: Please use comp.lang.php for PHP related questions,
>               alt.php* groups are not recommended.



Sun, 30 Oct 2005 21:42:08 GMT  
 text file and text box script

Quote:

> Thank you. But the .txt file isnt in the server web php. The .txt file is
> in the computer local which its seeing the php web.

You'll have to upload the file first so it is on the server. Otherwise,
you'll have to use a client-side language to do it.

--

PHP POSTERS: Please use comp.lang.php for PHP related questions,
              alt.php* groups are not recommended.



Sun, 30 Oct 2005 22:03:53 GMT  
 text file and text box script
If you want to manipulate data which is held on the client device you should
try cookies. Other than that the only way you can manipulate files of the
client device is to use a client-side language (such as JavaScript).
Remember that PHP is server side only.

Tony Marston


Quote:
> Thank you. But the .txt file isnt in the server web php. The .txt file is
> in the computer local which its seeing the php web.

> Its possible?

> Regards.
> Joca




> > > Hi.

> > > I have a .txt file with 3 lines of text.

> > > I have 3 text box too.

> > > I want that when i open a php page it reads the file .txt and in the
> text
> > > box 1 writing the line 1 of the file text, in the text box 2 writing
the
> > > line 2 of the file text .....

> > > Its possible? What can i do?

> > > Thank you
> > > Regards
> > > Joca

> > <?php
> >      $filename=dirname(__FILE__).'/filttoread.txt';
> >      $contents=file($filename);
> >      echo '<textarea name="text1">',$contents[0],'</textarea>',
> >          '<textarea name="text2">',$contents[1],'</textarea>',
> >          '<textarea name="text3">',$contents[2],'</textarea>';
> > ?>

> > --

> > PHP POSTERS: Please use comp.lang.php for PHP related questions,
> >               alt.php* groups are not recommended.



Sun, 30 Oct 2005 23:16:32 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to colorize, change font of text in text box

2. Accessing text in other applications windows text boxes

3. OODIALOG: TEXT MISSING IN A TEXT BOX

4. How to save new text in text box

5. SE Getting a File menu to work with a text box

6. Scrolling text within a file browsing list box

7. Some questions on elided text in the text widget (and a few other text widget questions)

8. Deleting text in text file

9. Email text body from text file?

10. How do I read lines of Text from Text File and add them to Array

11. Write 2D Text Array in a text file

12. Inserting a string of text into a text file

 

 
Powered by phpBB® Forum Software