Re: [PHP] Reading binary file data into variable

2005-06-17 Thread JamesBenson
I have one for windows, think it works with PHP4 aswell, not sure where i put it so let me know if you require it and Ill dig it up? problem is it wont work on Linux. Jay Blanchard wrote: [snip] Did you try using fopen's binary safe read? Something like : [/snip] Shy of being able to

[PHP] Reading binary file data into variable

2005-06-15 Thread Jay Blanchard
I am following Coggeshall's article on Zend for creating ZIP files. I seem to have run into a problem with PDF's though. In his code you have to read the file into a variable. I have tried file_get_contents, readfile, a combination of fopen, fpassthru, etc $filedata =

Re: [PHP] Reading binary file data into variable

2005-06-15 Thread John Nichel
Jay Blanchard wrote: I am following Coggeshall's article on Zend for creating ZIP files. I seem to have run into a problem with PDF's though. In his code you have to read the file into a variable. I have tried file_get_contents, readfile, a combination of fopen, fpassthru, etc $filedata =

RE: [PHP] Reading binary file data into variable

2005-06-15 Thread Jay Blanchard
[snip] Did you try using fopen's binary safe read? Something like : $binary_data = ; $fp = fopen ( $file, rb ); while ( ! feof ( $fp ) ) { $binary_data .= fgets ( $fp ); } fclose ( $fp ); Don't know if it will work (or if you already tried it)...more like a guess. [/snip] Yes, tried

RE: [PHP] Reading binary file data into variable

2005-06-15 Thread Jay Blanchard
[snip] Did you try using fopen's binary safe read? Something like : [/snip] Shy of being able to do this in the way that I imagined, does anyone know of a class (not requiring PHP 5, as one does on phpclasses.org) that will allow me to specify several PDF and/or other files in a directory to be

Re: [PHP] reading txt file - certain lines

2004-07-30 Thread Rory McKinley
Dustin Krysak wrote: snip Now what I want to do is read this file, but only say read 5 songs worth, then I would place the PHP code in (another table) and display the next 5 songs and so on This just allows for a more flexible layout in the final presentation. the way I am having the text

Re: [PHP] reading txt file - certain lines

2004-07-29 Thread Miroslav Hudak (php/ml)
Everything is possible :) And in this case, it seems, that lines are delimited by br ... i'm not quite sure, whether br can be used in explode as a delimiter, if so, you have no problem and you just read all the file into variable, $lines = explode('br', $variable) and you have lines in

[PHP] reading txt file - certain lines

2004-07-28 Thread Dustin Krysak
Hi there.. .I am displaying info (on music) from a text file with the following code... ?php //open the file handler $fp02=fopen(assets/lib/php/itunes/recent.txt,r); //Read the track info $recent=fgets($fp02); //close the file. echo $recent; fclose($fp02); ? Now the contents of said text file

Re: [PHP] reading txt file - certain lines

2004-07-28 Thread John Nichel
Dustin Krysak wrote: Hi there.. .I am displaying info (on music) from a text file with the following code... ?php //open the file handler $fp02=fopen(assets/lib/php/itunes/recent.txt,r); //Read the track info $recent=fgets($fp02); //close the file. echo $recent; fclose($fp02); ? Now the

Re: Re: [PHP] reading txt file - certain lines

2004-07-28 Thread Dustin Krysak
: From: John Nichel [EMAIL PROTECTED] Date: July 28, 2004 2:05:51 PM PDT To: PHP [EMAIL PROTECTED] Subject: Re: [PHP] reading txt file - certain lines Dustin Krysak wrote: Hi there.. .I am displaying info (on music) from a text file with the following code... ?php //open the file handler $fp02=fopen

[PHP] reading/parsing file names

2003-10-25 Thread koly
my problem: I've got a list of files in a directory, and I'd like to get a only of filenames that end in .jpg, however, exlude the files that end in .thumb.jpg ex: file.php index.htm photo.jpg photo.thumb.jpg etc how can I count only those files that end with .jpg ? Any help appreciated.

Re: [PHP] reading/parsing file names

2003-10-25 Thread Evan Nemerson
php.net/substr php.net/ereg php.net/preg_match foreach ( $files as $filename ) if ( substr($filename, -4) == '.jpg' ) array_push($jpegs, $filename); Keep in mind, though, that not all JPEG files end with jpg. There is also jpe and jpeg, and you have to consider case

Re: [PHP] Reading a file from another server

2003-07-26 Thread Thomas
I know the url is good, cause I can go on to this domain and look at all my files. I guess I should explain a little further... This server is a game server for Counter-Strike. I'm trying to read a file on there called mapcycle.txt. This server is a secure server, so I would need to use a

Re: [PHP] Reading a file from another server

2003-07-26 Thread CDitty
Have you tried downloading the file to your server and then read it from there? I do this at least 15 times a day with several different sites and I rarely have any problems. CDitty At 11:28 AM 7/26/2003, Thomas wrote: I know the url is good, cause I can go on to this domain and look at all

Re: [PHP] Reading a file from another server

2003-07-26 Thread Curt Zirzow
* Thus wrote Thomas ([EMAIL PROTECTED]): I know the url is good, cause I can go on to this domain and look at all my files. I guess I should explain a little further... This server is a game server for Counter-Strike. I'm trying to read a file on there called mapcycle.txt. This server

[PHP] Reading a file from another server

2003-07-25 Thread Thomas
Hi Everyone. I'm having problems creating code to read a file from another server. 1. Is this even possible? with a secure server aswell? 2. I have tried using fopen()but this always gives me an error: Warning: stat failed for http://www.domain.com/test.txt (errno=2 - No such file or

Re: [PHP] Reading a file from another server

2003-07-25 Thread Chris Shiflett
--- Thomas [EMAIL PROTECTED] wrote: I'm having problems creating code to read a file from another server. 1. Is this even possible? with a secure server aswell? Yes. this is my code: ?php $filename = http://www.domain.com/test.txt;; $handle = fopen ($filename, r);

Re: [PHP] Reading a file from another server

2003-07-25 Thread Thomas
if I use: readfile(ftp://username:[EMAIL PROTECTED]/test.txt); It doesn't have any errors and comes up blank. If I put: $result = readfile(ftp://username:[EMAIL PROTECTED]/test.txt); print ($result); it ends up showing a '0' by iteself. that's it. and I knwo the txt file is full of info.

Re: [PHP] Reading a file from another server

2003-07-25 Thread Chris Shiflett
--- Thomas [EMAIL PROTECTED] wrote: readfile(ftp://username:[EMAIL PROTECTED]/test.txt); It doesn't have any errors and comes up blank. If I put: $result = readfile(ftp://username:[EMAIL PROTECTED]/test.txt); print ($result); it ends up showing a '0' by iteself. The readfile()

[PHP] reading a file into variable for using in a javascript

2003-06-08 Thread Charles Kline
Hi all, I am reading the content of a text file into a variable to be used in a javascript. I am reworking some code that was originally done using ColdFusion and the jsStringFormat(var) function. What is the PHP equivalent string function? Is there one? I have searched the docs, but can't

[PHP] Reading from file on local disk to server

2003-03-20 Thread Jan Meiring
Hi everyone This is what I want to do: I have a file on each workstation that gets created each time the pc is rebooted - the file save the pc configuration plus the current user logged onto the machine, I want to read from that file variables so that I can save it to my mySQL database and

[PHP] Reading Text file by line

2003-02-24 Thread Anthony
I need to read a text file by line, if I open the file and use fgets() then it doesn't pick up the EOL corretly. So I was planning on reading the whole file in with fread() and then breaking it up by EOL characters. My question is, how do I do it? What character do I search for in the string?

RE: [PHP] Reading Text file by line

2003-02-24 Thread M.A.Bond
Using $var=file('filename.txt'); Creates an array, with each element in the array being 1 line of the file. Thanks Mark -Original Message- From: Anthony [mailto:[EMAIL PROTECTED] Sent: 24 February 2003 16:24 To: [EMAIL PROTECTED] Subject: [PHP] Reading Text file by line I need

Re: [PHP] Reading Text file by line

2003-02-24 Thread Ernest E Vogelsinger
At 17:24 24.02.2003, Anthony spoke out and said: [snip] I need to read a text file by line, if I open the file and use fgets() then it doesn't pick up the EOL corretly. So I was planning on reading the whole file in with fread() and then breaking it up by

[PHP] Reading Session File from /tmp directory

2002-04-18 Thread Devin Atencio
I am trying to read a session file from the /tmp directory then restore the PHP variables from this but I can't get it to work, i'm doing the following: $acontents = file(/tmp/sess_$sessid); $data = $acontents[0]; unserialize($data); $sessid is a valid session id, but unserialize

Re: [PHP] reading excel file

2002-04-03 Thread EMIN CALIKLI
] reading excel file 03.04.2002

[PHP] reading excel file

2002-04-02 Thread Tyler Longren
Hello List, Has anyone ever converted an excel file over to a MySQL database via PHP? I'm currently doing it with perl, and this isn't a very good option for me. The client needs to login to a server via ssh every time they want to put data from their excel file to mysql. I'd like to find some

RE: [PHP] reading excel file

2002-04-02 Thread Jason Murray
Has anyone ever converted an excel file over to a MySQL database via PHP? I'm currently doing it with perl, and this isn't a very good option for me. The client needs to login to a server via ssh every time they want to put data from their excel file to mysql. I'd like to find some way

Re: [PHP] reading excel file

2002-04-02 Thread Tyler Longren
Message - From: Jason Murray [EMAIL PROTECTED] To: 'Tyler Longren' [EMAIL PROTECTED]; php-general [EMAIL PROTECTED] Sent: Tuesday, April 02, 2002 7:32 PM Subject: RE: [PHP] reading excel file Has anyone ever converted an excel file over to a MySQL database via PHP? I'm currently doing

RE: [PHP] reading excel file

2002-04-02 Thread Martin Towell
- Original Message - From: Jason Murray [EMAIL PROTECTED] To: 'Tyler Longren' [EMAIL PROTECTED]; php-general [EMAIL PROTECTED] Sent: Tuesday, April 02, 2002 7:32 PM Subject: RE: [PHP] reading excel file Has anyone ever converted an excel file over to a MySQL database via PHP? I'm

RE: [PHP] reading excel file

2002-04-02 Thread Jason Murray
Thanks Jason, that is a pretty good idea. Any idea how well PHP handles large ammounts of data like that? There'll be about 25,000 lines in every excel file, and they come in groups of 5 or 6. I've rigged up an import script for similar functions before, it seems to run ok... it really

RE: [PHP] reading excel file

2002-04-02 Thread Jason Murray
If it's possible, it probably better to deal with each line by itself, rather than try to load to whole file into memory. Good point. Shared server admins probably hate me. ;) J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] reading excel file

2002-04-02 Thread Vail, Warren
215 Fremont 02-658 -Original Message- From: Jason Murray [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 02, 2002 5:33 PM To: 'Tyler Longren'; php-general Subject: RE: [PHP] reading excel file Has anyone ever converted an excel file over to a MySQL database via PHP? I'm currently

[PHP] Reading A file

2002-03-06 Thread Sven Jacobs
Hey I have a TEXT file that I want to make visual via the web using php

RE: [PHP] Reading A file

2002-03-06 Thread Jon Haworth
I have a TEXT file that I want to make visual via the web using php ?php include (my_text_file.txt); ? HTH Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Reading A file

2002-03-06 Thread Ing. Fernando Proll Segura
Hey I have a TEXT file that I want to make visual via the web using php Maybe this isn't the best way but to do this I use the following code: ?php function do_print($item2,$clave) { echo $item2.BR; } $lines=file(yourfile.txt); array_walk($lines,'do_print'); ? As you can see I

RE: [PHP] Reading A file

2002-03-06 Thread Sven Jacobs
-pre01:index index was never started -Original Message- From: Ing. Fernando Proll Segura [mailto:[EMAIL PROTECTED]] Sent: mercredi 6 mars 2002 15:13 To: Sven Jacobs; [EMAIL PROTECTED] Subject: Re: [PHP] Reading A file Hey I have a TEXT file that I want to make visual via the web using

RE: [PHP] Reading A file and placing data into db

2002-03-06 Thread Sven Jacobs
-pre01:index index was never started -Original Message- From: Ing. Fernando Proll Segura [mailto:[EMAIL PROTECTED]] Sent: mercredi 6 mars 2002 15:13 To: Sven Jacobs; [EMAIL PROTECTED] Subject: Re: [PHP] Reading A file Hey I have a TEXT file that I want to make visual via the web using

[PHP] reading a file into a string problem : $string = join ('', file (/location/$dynamic.iq))

2001-12-19 Thread Lee Philip Reilly
Hi, I wonder if someone can help me solve this niggling problem: I have a hyperlink [javascript:openwindow('http:myserver/files.php?expid=67.iq')], which passes the argument 'expid' to the PHP script, where 'expid' is the name of a file. I want to take the file data and put it into a string.

[PHP] reading from file

2001-07-25 Thread Stefan Kostopoulos
I am using the script include below to read the content of a file and output it. When I load this script with the adress of a plain html file it outputs everything like expected, except there are some extra characters spread over the file. They come in little string like '40d' or '1000' and

Re: [PHP] Reading a file and changing a href tag values

2001-04-14 Thread Plutarck
All you need is a regular expression, provided by ereg function or preg functions. You'd have the regex look for a href then capture everything up to /a Then just adjust the result as you want it to appear. You'll need to either search around for code that already does this, or be willing to

[PHP] Reading a file and changing a href tag values

2001-04-13 Thread Brett
I have been able to find out how to read a file and replace certain matches, but I want to be able to take a web page stored in a string and change the a href tags and add www.mysite.com?page= before the actual link value so the new url would read www.mysite.com?page=original_url. Can I do