Results 1 to 8 of 8
Radio Buttons Return Nothing Forum: HTML ForumReplies: 7
Automaticaly return to top of page Forum: HTML ForumReplies: 1
return form info as webpage Forum: PHP ForumReplies: 0
Refreshing a window on return from a popup Forum: Website Scripts ForumReplies: 3
05-10-2003, 11:40 AM #1
geting return linefeed codes on php
Hi, I have been trying to write a online catalogue for work using php4+apache+winxp+mysql to replace a very slow one.
It all works but if i write to a text file, info which people have searched for when i edit it in notepad there are no linefeeds chr returns. ITS ALL ON ONE LINE.
1. How do i when writing text to a file force a linefeed.???
2. The same is true of the following
readfile ("readme.txt" ); It does not show linefeeds.??
its located at http://184.108.40.206/main.php for timebeing.
how secure is it as the apache log shows quite a few \scripts\cmd.exe c:\dir 404 messages messages.
Not bad for around 4 days work.
Last edited by HTML; 03-20-2007 at 08:40 PM.
05-10-2003, 12:16 PM #2
Windows XP is not secure to run a server at all. And the windows port of Apache is designed for testing on, not for running a host. I would not use this on the web.
Linefeeds in windows are
05-10-2003, 12:18 PM #3
for readfile , if its showing in a browser then it qont show the linefeeds because you need to replace the \r\n or \n characters with <br /> for it to work. lookup ereg_replace in the php manual.
05-10-2003, 12:19 PM #4
It is important to use 'a' as the mode. This will add the new entry to the end of the file. 'w' writes to the beginning.
$string = 'this is a string';
$file_handle = fopen('readme.txt', a);
fwrite($file_handle, $string . "\n");
Last edited by sonofmidi; 05-10-2003 at 12:22 PM.
05-10-2003, 02:51 PM #5
Thanks for the linefeed bit, It works ok now.
Re Apache on win XP not Secure.
Im only really trying it at the moment. The catalogue will never have any online ordering on it, only for our customers to view items.
05-10-2003, 03:24 PM #6
More worried about having it a server in any sense, really. Once they are on one box, they got your whole network to play with...
05-10-2003, 03:45 PM #7
The server is on my home pc with adsl line Not at work.
05-10-2003, 05:31 PM #8
Hope you dont keep your credit card number on there..
Honestly, running a win2k server with IIS would be more secure than a winxp box running apache (and thats saying something!).
but at the end of the day, its up to you.