Jump to content

copy content from text file to htm file using php


sandhya

Recommended Posts

hi all,

    I have to read the content of text file and write here in working htm file. For this i'm using the following code.

 

$myFile = "Friendship/friend.txt";

$fh = fopen($myFile, 'r');

$theData = fread($fh, filesize($myFile));

fclose($fh);

echo $theData;

 

But it reads and displays the content in the htm file like this.

 

��<�b�r�>�<�c�e�n�t�e�r�>��

�<�t�a�b�l�e� �c�e�l�l�s�p�a�c�i�n�g�=�"�0�"� �w�i�d�t�h�=�"�6�0�0�"� �h�e�i�g�h�t�=�"�4�0�0�"� �s�t�y�l�e�=�"�b�o�r�d�e�r�:�4�0�p�x� �s�o�l�i�d� �#�0�0�0�"�>�<�t�d� �b�g�c�o�l�o�r�=�"�0�"� �v�a�l�i�g�n�=�"�t�o�p�"� �a�l�i�g�n�=�"�c�e�n�t�e�r�"�>�<�h�r� �s�i�z�e�=�"�1�0�"� �s�t�y�l�e�=�"�b�o�r�d�e�r�:�1�2�p�x� �o�u�t�s�e�t� �#�D�7�7�D�8�2�"�>�<�b�r�>�<�b�r�>��

�<�i�m�g� �s�r�c�=�"�h�t�t�

 

what are these symbols? how can i do it? I didn't gave full out put. Plz give me a solution. thanks in advance.

 

Link to comment
Share on other sites

ya sure here it is..

 

<br><center>

<table cellspacing="0" width="600" height="400" style="border:40px solid #000"><td bgcolor="0" valign="top" align="center"><hr size="10" style="border:12px outset #D77D82"><br><br>

<img src="http://lh5.ggpht.com/_ilb4DaDhZFA/SSspX_xmxNI/AAAAAAAABLs/6508KXHenTY/s800/remoteImage-99.png"width="530">

<a href="/Community.aspx?cmm=36189948">

<font face="Georgia" style="font-size:18px" color=E6A49D><br>

<BR>

"Maybe the best friendship

are those where there is much discussion,

much dispute and even so much affection."

(George Eliot)

<br>

Be happy & keep smiling my friend!

<img src=http://lh4.ggpht.com/__NkTUSIKIhA/SUAD2YyCOGI/AAAAAAAAA44/l2GjYzvp0UE/s800/406347qw4w1xy7y1.png>

<hr><hr><font size=3>

★ Stylish Orkut Scraps ★™

<hr size="10" style="border:12px outset #D77D82">

 

this is basically orkut aplication based.

Link to comment
Share on other sites

one more thing just tested in another system. there i find like this..

 

 

��<br><center>

<table cellspacing="0" width="600" height="400" style="border:40px solid #000"><td bgcolor="0" valign="top" align="center"><hr size="10" style="border:12px outset #D77D82"><br><br>

<img src="http://lh5.ggpht.com/_ilb4DaDhZFA/SSspX_xmxNI/AAAAAAAABLs/6508KXHenTY/s800/remoteImage-99.png"width="530">

<a href="/Community.aspx?cmm=36189948">

<font face="Georgia" style="font-size:18px" color=E6A49D><br>

<BR>

"Maybe the best friendship

are those where there is much discussion,

much dispute and even so much affection."

(George Eliot)

<br>

Be happy & keep smiling my friend!

<img src=http://lh4.ggpht.com/__NkTUSIKIhA/SUAD2YyCOGI/AAAAAAAAA44/l2GjYzvp0UE/s800/406347qw4w1xy7y1.png>

<hr><hr><font size=3>

★ Stylish Orkut Scraps ★™

<hr size="10" style="border:12px outset #D77D82">

 

why like this?

Link to comment
Share on other sites

hi vinod thanks for u r reply. u r right that it works on some systems. here also i have tried in another systems also. for 4 systems its working on 1 system only. Its not working in another systems. and my os is Vista. and others are Windows XP. What could be the problem?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.