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
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 =
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 =
[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
[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
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
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
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
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
:
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
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.
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
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
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
* 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
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
--- 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);
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.
--- 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()
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
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
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?
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
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
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
] reading excel file
03.04.2002
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
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
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
- 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
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
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
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
Hey
I have a TEXT file that I want to make visual via the web using php
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
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
-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
-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
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.
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
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
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
42 matches
Mail list logo