Re: [PHP] Problem changing file encoding

2008-10-22 Thread Ian
On 22 Oct 2008 at 14:39, Thodoris wrote: Hi guys, I am developing a project and I wrote an interface to import contracts in it. The problem is that when the user uploads the file I don't know what is the encoding it has. So I decided that a good idea is to make the user tell me the

Re: [PHP] Problem changing file encoding

2008-10-22 Thread Yeti
A neat way to transcode between different encodings is htmlentities and html_entity_decode [1, 2] EXAMPLE: ?php # encode a string in UTF-8 to html entities $string = 'øæåöäü'; $string = htmlentities($string, ENT_QUOTES, 'UTF-8'); # transcode it into ISO-8859-15 $string =

Re: [PHP] Problem changing file encoding

2008-10-22 Thread Thodoris
On 22 Oct 2008 at 14:39, Thodoris wrote: Hi guys, I am developing a project and I wrote an interface to import contracts in it. The problem is that when the user uploads the file I don't know what is the encoding it has. So I decided that a good idea is to make the user tell me the

Re: [PHP] Problem with file reading

2007-01-05 Thread Stut
Delta Storm wrote: I'm a beginner and i'm still learning PHP and I got a problem: $file = http://localhost/test_folder/test1.txt;; //I have also tried test_folder/test1.txt and text1.txt $fh = fopen($file, r) or die(Could not open file!); $data = fread($fh,

Re: [PHP] Problem with file reading

2007-01-05 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-05 16:34:41 +: Delta Storm wrote: I'm a beginner and i'm still learning PHP and I got a problem: $file = http://localhost/test_folder/test1.txt;; //I have also tried test_folder/test1.txt and text1.txt $fh = fopen($file, r) or

Re: [PHP] Problem with file reading

2007-01-05 Thread Stut
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-05 16:34:41 +: Delta Storm wrote: I'm a beginner and i'm still learning PHP and I got a problem: $file = http://localhost/test_folder/test1.txt;; //I have also tried test_folder/test1.txt and text1.txt $fh

Re: [PHP] Problem with file reading

2007-01-05 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-05 17:17:46 +: Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-05 16:34:41 +: Delta Storm wrote: I'm a beginner and i'm still learning PHP and I got a problem: $file = http://localhost/test_folder/test1.txt;; //I have also tried

Re: [PHP] Problem with file reading

2007-01-05 Thread Stut
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-05 17:17:46 +: Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-05 16:34:41 +: Delta Storm wrote: I'm a beginner and i'm still learning PHP and I got a problem: $file =

Re: [PHP] Problem with file reading

2007-01-05 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-05 17:40:49 +: Using mod_php with Apache will make the current directory the directory that contains the script being requested. I am assuming that the OP is trying to access the file from the script that is being requested and not an included file in a

Re: [PHP] [Problem] - reading file

2006-02-06 Thread Chris
Hi Roman, This line is your problem. $lines = preg_replace(/\n/, br, $lines); You're replacing your newlines with br tags. Your explode won't find anything because it's looking for \n 's. Labunski wrote: Hello, The problem is, that script outputs Last line from the file (and not first

RE: [PHP] problem with file upload script

2004-09-27 Thread Jay Blanchard
[snip] Here is a script I'm using to upload files. Can anyone see anything wrong with it? No file is uploaded when I click the upload button [/snip] Start here http://us4.php.net/manual/en/features.file-upload.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Problem with file()

2002-04-16 Thread Justin Blake
Zambra - Michael wrote: What kind of line ending does the file() function include in the array elements. I'm having problem with file() combined with implode() when reading in complete HTML files in a Windows environment. After parsing these resulting strings I get tons of white lines (??).

Re: [PHP] problem with file writing

2002-03-16 Thread Jason Wong
On Sunday 17 March 2002 12:53, Ben Waldher wrote: I'm having some trouble writing data to a file, when I use this code it works fine: ?php $file = fopen(template.txt, w); fwrite ($file, $temp); fclose ($file); ? But several problems with this occur: ?php $stuff = include

Re: [PHP] problem with file upload

2001-01-19 Thread Richard Lynch
? for ($i=0 ; $i 4 ; $i++) { file://do something for ($k=0 ; $k 3 ; $k++) { print "input type=\"checkbox\" name=\"checkans[$i][$k]\" value=\"".$K."\" "; file://this is working print "input type=\"file\" name=\"ans[$i][$k]\" "; file://this is not } }

Re: [PHP] problem with file upload

2001-01-19 Thread Ignacio Vazquez-Abrams
On Fri, 19 Jan 2001, Richard Lynch wrote: ? for ($i=0 ; $i 4 ; $i++) { file://do something for ($k=0 ; $k 3 ; $k++) { print "input type=\"checkbox\" name=\"checkans[$i][$k]\" value=\"".$K."\" "; file://this is working print "input type=\"file\"