question concerning fgets() - please help 
Author Message
 question concerning fgets() - please help

Hi,

I am a newbie in php, so maybe my question is silly or allready answered
a million times... If so - sorry, but please be patient with me :-)

I am writing for internal use a script to analyse email-logfiles, the
main task is done with perl which gives me an text-file containing the
relevant information

(and so on).
When I try to read a line from this file via
           $line =  fgets($filehandle, 4096);
all characters _between_  <  and  >  are vaporized ('<' and '>' also).

Any idea how to avoid this?
(phpversion is 4.2.1)

Thanks a lot
                and have a good time
                                                Hermino



Sun, 26 Jun 2005 19:30:27 GMT  
 question concerning fgets() - please help

Quote:
> When I try to read a line from this file via
>           $line =  fgets($filehandle, 4096);
> all characters _between_  <  and  >  are vaporized ('<' and '>' also).

I don't think it's fgets that's doing this, it's the web browser that
thinks it's an unknown html tag. You need to translate them to &lt; and
&gt; to display in a browser.

Look at the following from the manual:
   http://www.php.net/manual/en/function.htmlspecialchars.php

Kevin Thorpe



Sun, 26 Jun 2005 20:31:47 GMT  
 question concerning fgets() - please help
Hi Kevin,

great, You've been right, now everything works fine!
Thanks a lot!
                Hermino

(this is the reason I like the web so much:
getting _useful_ information very fast!)

Quote:

>> When I try to read a line from this file via
>>           $line =  fgets($filehandle, 4096);
>> all characters _between_  <  and  >  are vaporized ('<' and '>' also).

> I don't think it's fgets that's doing this, it's the web browser that
> thinks it's an unknown html tag. You need to translate them to &lt; and
> &gt; to display in a browser.

> Look at the following from the manual:
>   http://www.php.net/manual/en/function.htmlspecialchars.php

> Kevin Thorpe



Sun, 26 Jun 2005 21:03:16 GMT  
 question concerning fgets() - please help

Quote:

> Hi Kevin,

> great, You've been right, now everything works fine!
> Thanks a lot!
> Hermino

Another option is to wrap your output in an textarea element:

<form action="foo" method="post">
<textarea name="foo">
put your HTML here, and you'll be able to see the tags.
</textarea>
</form>

--
----- stephan beal
Registered Linux User #71917 http://counter.li.org
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.



Sun, 26 Jun 2005 21:53:19 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Some questions concerning prolog, help !!!!!

2. HELP: question concerning text widget

3. please, please, please, please, help

4. will someone please, please, please, please HELP me?!!

5. Concerning "Forth 97" Please Read

6. X3D concern -- a copy of a letter I recently sent to some X3D members -- please comment

7. VSE 3.1 Repository Problem: Please help (please please?)

8. PLEASE PLEASE PLEASE HELP !!!!!!!!!!!!

9. please,please please do help us

10. help please-----please help about array in DLL

11. HELP !..PLEASE,PLEASe,PLEAse,PLEase,PLease,Please,please.....

12. System Task $fgets

 

 
Powered by phpBB® Forum Software