Re: [PHP] Opensource webshop

2005-09-22 Thread Chris Martin
On 9/22/05, Greg Donald [EMAIL PROTECTED] wrote:
 Not to mention the ones written in Perl.

I think you just did ;)

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php vulnerability

2005-08-22 Thread Chris Martin
You might also scan your machine (and/or network) with something such
as nessus, or another vulnerability scanner

-- 

Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Beautiful HTML Invoice - Prints like crap! I need somesuggestions!

2005-06-08 Thread Chris Martin
On 6/7/05, Matt Babineau [EMAIL PROTECTED] wrote:
 Yeah I was considering that...I'm trying the html2pdf site right now. It
 seems alright...its choking on my invoice as we speak (lots of html).
 
 Is there a way to make a JPG? I've looked at a few sites from google..most
 are activeX...somewhat undersirable. Looking for something I can run on the
 server to do the convert work.
 
 Thanks,
 
 
 Matt Babineau
 Criticalcode
 w: http://www.criticalcode.com
 p: 858.733.0160
 e: [EMAIL PROTECTED]
 
 -Original Message-
 From: Jack Jackson [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 07, 2005 3:21 PM
 To: php-general@lists.php.net
 Subject: Re: [PHP] Beautiful HTML Invoice - Prints like crap! I need
 somesuggestions!
 
 Matt Babineau wrote:
 
 Hi all -
 
 I've got a great html invoice that prints like crap because of my user
 of background images and foreground images. Does anyone have any good
 suggestions other than turn on images in IE to get this thing to print
 the graphics? Is there a good way I could convert the HTML view to a
 JPG? I'm on a linux box and have php 4.3.10.
 
 Thanks for the help!
 
 Matt Babineau
 Criticalcode
 w: http://www.criticalcode.com
 p: 858.733.0160
 e: [EMAIL PROTECTED]
 
 
 
 
 Make it a pdf?
 


Is a simple CSS print stylesheet out of the question?
If the site is marked up properly, this should be trivial, and would
be much easier/more efficient.

IMO the only image that should be on a printed invoice, is the logo (if any).

-- 
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Using Google's API with PHP

2004-10-30 Thread Chris Martin
Rahul S. Johari wrote:
Ave,
Has anyone been able to successfully use the Google API with PHP here? I've
been trying different scripts and each one gives me a similar Unexpected
T_Function error. 

The other script from digitalpoint.com does run but it doesn't read my $q,
basically it displays all results from google.. It doesn't actually read my
query at all.
Any help would be appreciated.
Ave.
Rahul S. Johari
Coordinator, Internet  Administration
Informed Marketing Services Inc.
(518) 266-0909 x154
http://www.informed-sources.com
I've done this using the NuSOAP class.
http://www.chriscodes.com/google/
I have a simple source code example. You'll need to include NuSOAP, and 
to replace Your Google License KEY in the example with Your Google 
License KEY.

http://www.chriscodes.com/google/google.phps
There's a somple tutorial at:
http://www.devshed.com/c/a/PHP/Using-The-Google-Web-APIs-With-PHP/
--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: create and read array

2004-09-11 Thread Chris Martin
Alexander Kleshchevnikov wrote:
Maybe you want this:
while ($data = mysql_fetch_assoc($news)) {
$sql += INSERT INTO newtable VALUES ($data['AUS'], $data['id']);\r\n;
}
If you nevertheless want save the data in array you can use a
two-dimensional array $authors:
$authors = array();
while ($data = mysql_fetch_assoc($news)) {
$authors[] = array('AUS' = $data['AUS'], 'id' = $data[id]);
}
..
foreach ($author in $authors) {
$sql += INSERT INTO newtable VALUES ($author['AUS'],
$author['id']);\r\n;
}
--
Seigo
www.geocities.com/seigo_ua/

Just a note to help the learning process. Either mysql_fetch_assoc() and 
mysql_fetch_array() will return your result in an array, so you don't 
need to actually create one.

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP IDE for OS X

2004-09-04 Thread Chris Martin
Justin French wrote:
Can anyone suggest a PHP editor/IDE for OS X other than:
- BBEdit (already using it)
- Zend Studio (it's Java, not OS X native)
What I'm hoping for is:
- some form of auto-complete text for functions/constants/etc,
- integrated testing/debugging
- integration with local install of PHP
- anything else that will make my life easier without 'getting in the way'.
My guess is it doesn't exist, but it's worth a shot.
PLEASE, no On Windows I use... or I just use 'Text Editor X' -- I'm 
looking for something more than a basic text editor, and it has to be OS 
X native (not some ugly, sluggish Java thing).

---
Justin French
http://indent.com.au
I don't run OSX, so I don't know how easy this is, but it's definately 
worth the mention.

OSX has a unix core. I saw a bit on TechTV saying if you install the 
developer tools, you can run virtually any *nix app.
See these for more info
http://developer.apple.com/unix/index.html
http://developer.apple.com/unix/toolkits.html
http://fink.sourceforge.net/

I saw some tutorials searching google for run linux apps on Mac too.
That said, you could give Quanta Plus or Bluefish a shot, both are great 
free linux apps. My personal favorite is Quanta Plus, it contains most 
of what you mentioned (even auto-completes your variables)

On the non-free side, Dreamweaver MX has some decent PHP features, 
although it's a pricey solution.
mac stab You should be use to that though! ;) /mac stab

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: installing PHP on winXP

2004-09-04 Thread Chris Martin
Gerben wrote:
hi there
I have a problem with installing PHP on my winXp with apache server using 
the installer. I'm missing the sapi directory (c:/progra~1/php/sapi/) with 
in it the php4apache.dll file which apache misses.
The weird thing is that I've succesfully installed php and apache on this 
same machine, but now it's not working.
I've copied my httpd.conf and php.ini files from my last (succesfull) 
installation.

I have apache 1.3.28 and php 4.3.4 (but the latest version 4.3.8 also 
doesn't work)

Please help |:-( 

Are your paths the same as they were in your last install? If not, you 
need to update the conf files. Especially your modules directory

You might read along the PHP manual install instructions and verify 
everythings in the right place. I always prefer the manual install 
anyway. I usually place php4apache.dll (and php4ts.dll) in the Apache 
root, or Apache/modules directory

If all else fails you could uninstall and try the WAMP bundle.
--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Does any one else get this?

2004-09-04 Thread Chris Martin
Jack Gates wrote:
Every time I post to the list, I get an undeliverable on the address below.  
Does any one else get this?

If this address is on the list can we get it removed?
To:  [EMAIL PROTECTED]
Subject: [PHP] PHP site ?
was undeliverable due to the following reason:
[EMAIL PROTECTED] - User doesn't exist or is inactive.

I don't get them from that address, but I get them from
From: Mailer Iguanahosting.com [EMAIL PROTECTED]
Subject: Destinatario No exitente
On top of that I've received post confirmations for messages I never 
sent. Hopefully since I never confirmed them, they never made it. I 
don't want to be considered one of the spammers that I'd like to knock 
the F* out.

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: uppercase sentences

2004-09-03 Thread Chris Martin
Justin French wrote:
Hi all,
I'm working with a bunch of users who hardly ever use correct 
punctuation in their submitted content.  I realise there's very little I 
can do, but I'm trying to do *something* to make things a little more 
presentable.  At the very least, ensuring that all sentences begin 
with a capital letter (english) would be a great start.

Has any one come across a library of punctuation cleaners or something 
like that?

---
Justin French
http://indent.com.au
Check out the many wonderful string functions at
http://php.net/strings
In particular, for all uppercase, you'll probably find 'strtolower()' 
helpful. And, as Jim mentioned, ucfirst() will capitalize the first letter.

There's a bunch more that can help you control what they're sending you. 
(Isn't it amazing what people will enter in a form??)

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP to replace javascript

2004-09-03 Thread Chris Martin
Mark wrote:
--- Jack Gates [EMAIL PROTECTED] wrote:

Greetings,
This is my first post here and I am still new to PHP and learning. 
I just 
joined this list last night.

Javascript can open a separate and specifically sized window from a
web page 
when a user clicks on a link that might reference a note or picture
etc.

Can this be done with PHP?  If yes, will someone tell me where in
the manual 
on the php.net site I can find the information to learn how to do
this?

I have been looking through the manual on the site but without
knowing the 
name or names of what I am looking for it is real hard to find it.


Since PHP is a server-side language, it can't really tell the browser
to do anything. However you can generate javascript from your PHP
code (if necessary) to open (and close) browser windows.
Mark
=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***
Mark is right, this can be very useful.
Especially if, say you have multiple images at different sizes that 
you're opening in a pop up, and you want each window to fit the image 
perfectly. You could then use PHP to get the size of the image, to then 
dynamically insert into the JavaScript.

Congrats on RTFM!! It seems daunting at first, but as you learn more, it 
will become your friend.

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: annoying autoreplies

2004-08-08 Thread Chris Martin
Robby Russell wrote:
To all those who have auto-replys set for their email, please turn them
off. ;-)
We shouldn't have to opt-in to 3 different peoples spam email sites so
that we can post to the list. heh.
-Robby
Seriously, we shouldn't have to setup a new mail filter everytime we 
reply either!

At least they're not on PDXLUG!!!
--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: FW: IMPORTANT: Please Verify Your Message

2004-08-07 Thread Chris Martin
Curt Zirzow wrote:
* Thus wrote Ed Lazor:
Gawd this stuff sucks.
Nothing like a spammer posing as the list itself and farming email addresses
from members.

Its odd, i've yet to get one of those. Either the spammers dns
doesn't resolve proper (cause my server rejects those) or if its
due to the fact I only reply-to-list.
I'm assuming its a dns issue at this point.
Curt
I read and reply through gmane, and I got them. But I don't see them 
anymore because they're filtered directly to the trash.

Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Dreamweaver PHP

2004-08-06 Thread Chris Martin
Vinayakam Murugan wrote:
Hello
This takes up a lot of time and is error-prone too. 
What exactly is error prone?
Is  there any better way of doing it?
Yes, just have Dreamweaver do it the first time (when the form is created)
Can Dreamweaver be used completely for 
PHP-MySQL applications?
Yes (although it generates some ridiculous code)

Is there any GPL alternative for this kind of stuff?
What kind of stuff? Editing PHP? Quanta, or Bluefish.
--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Sessions Problem !!

2004-08-06 Thread Chris Martin
Dre wrote:
the exact error messages are

==
Warning: session_start(): open(/tmp\sess_000c30790862f64268e755546b6fcbb2,
O_RDWR) failed: No such file or directory (2) in C:\Program Files\Apache
Group\Apache2\htdocs\maillist\maillist\admin.php on line 1
First, if you want to store session data on win32, you'll need to change 
the session.savepath in your php.ini.
open it and search for:
session.save_path
and change it from
session.save_path = /tmp
to
session.save_path = C:\WINDOWS\Temp (Or wherever your temp folder is if 
you're not on XP)

Warning: session_start(): Cannot send session cookie - headers already sent
by (output started at C:\Program Files\Apache
Group\Apache2\htdocs\maillist\maillist\admin.php:1) in C:\Program
Files\Apache Group\Apache2\htdocs\maillist\maillist\admin.php on line 1
This error tells you that the output was started at line 1 of your 
admin.php file. (maybe a blank line at the top of the script?)

As Miles suggested:
You have to call session_start() before any output to the page, even a 
single space.

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Sessions Problem !!

2004-08-06 Thread Chris Martin
Dre wrote:
Thanks Chris ... problem solved, I'm sorry but these configuration details
is a bit new for me
Originally I'm a C++ programmer and web development is not my major kind of
work
Thanks again
Good.
I think that little tidbit was actually left out of the windows install 
notes, but I could've just overlooked it.

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: [Q] How to setup Dreamweaver so that PHP scripts are executed?

2004-08-06 Thread Chris Martin
Michael T. Peterson wrote:
Hi,
I know this must be really obvious to many of you, but I have been unable to
configure DW (using [preferences] or [site-edit]) so that it will execute a
php script from a form action=foo.php... tag.  When the submit button is
clicked the php file is displayed, rather than executed.
Here's the HTML code of the submit button form:
form action=update_river_measurements.php method=post name=form1
target=mainFrame
 select name=interval_period
  optionSelect interval/option
  option value=22 days/option
  option value=44 days/option
  option value=88 days/option
  option value=3131 days/option
  /select
 input type=submit value=Update Database
/form
When the [Update Database] button is clicked, the file specified by the
action parameter is displayed, rather than executed.
My dev machine is a Windows XP system with Apache, PHP, and MySQL installed.
I have confirmed that my Apache-PHP configuration is correctly configured.
For example,  PHP correctly executes the script when I pass
update_river_measurements.php to IExplore.exe from the command line. Also,
when I upload these local files to my ISP, the PHP also executes correctly.
Any suggestions as to how to get DW to execute these files would be
appreciated.
Cheers,
Michael
P.S. Cross-posted to the DreamWeaver news group
I'm not sure that dreamweaver will execute them.
If you've got Apache/PHP setup, just go to 
http://localhost/your_script.php in your browser to test them out, no 
need to use the command line to pass to a browser.

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: php coding software

2004-08-02 Thread Chris Martin
Jordi Canals wrote:
Brad Ciszewski wrote:
Does anyone know any good software for PHP/mysql coding? I currently use
DreamWeaver MX, however it doesn't have much PHP support, and no MySQL
support. I just want an easy program to script in, and upload on to my
webserver. Please help! :o

Sorry, but you're wrong. Dreamweaver DOES have MySQL support and can 
connect to MySQL databases to help coding your scripts.

Yes. PHP and MySQL is supported in DWMX, no extensions required.
FTPEdit and HTMLKit are both free editors for Windows
Quanta and Bluefish are excellent on GNU/Linux
--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP5 Manual in PDF and for Pocket PCs

2004-07-31 Thread Chris Martin
Jason Barnett wrote:
As far as I know, no one has done that yet.  Although all of the PHP 
manual pages are written in XML so if you were so inclined you could do 
it yourself. And I'm sure others would appreciate it if you shared it :)

You could use HTMLDoc to convert the html pages to pdf.
http://www.easysw.com/htmldoc/
--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Creating a PHP5 RPM

2004-07-27 Thread Chris Martin
Marcus Bointon wrote:
I normally compile PHP straight from the regular source, however, this means
that RPM loses track of what PHP version is installed on RedHat Linux (EL3),
causing dependency and version mismatch problems. So it appears that I need
to build an RPM from the normal source, then install it with RPM. However, I
have no idea how to do this - can anyone give me some pointers? Is it as
simple as adding a configure switch like --build-rpm?
Thanks,
Marcus
I haven't done it myself yet, but I've been thinking about the same 
thing. I had bookmarked these how to's while searching google.

http://user.cs.tu-berlin.de/~ccorn/software/rpm/build-rpm.html
http://www3.sympatico.ca/sarrazip/dev/rpm-building-crash-course.html
http://www-106.ibm.com/developerworks/library/l-rpm2/
--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: php paypal

2004-07-27 Thread Chris Martin
Vail, Warren wrote:
Did you think of saving the information (invoice number) in a session or
cookie before sending them off to paypal, for use when the user returns?
Warren Vail
-Original Message-
From: Mike R [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 27, 2004 8:51 AM
To: Jason Davidson
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] php  paypal


That's trueI didn't even think of that.  Not a cc number, but, say, an
invoice number that the person starts with before they go off to paypal and
return from paypal with the same invoice number so that I can then do more
things with the user (the invoice number being unique).
:)
Thanks,
-Mike


Might be easier to use session vars to track whatever it is your 
tracking.

Jason
On Tue, 27 Jul 2004 11:11:31 -0400, Mike R 
[EMAIL PROTECTED] wrote:

Does anyone know if it is possible to pass a variable in the URL to 
the return page when using paypal?

Meaning, when someone is done a transaction in paypal and they
return the
merchant's site, can a variable be passed all of the way
through back to the
merchant's site?
:)
-Mike
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Not in the URL.
Read the PayPal docs, they post back a form to the return page. Most of 
what you're looking for will be there, otherwise there are a few custom 
fields you can use (for say an invoice number).

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: [Fwd: IMPORTANT: Please Verify Your Message]

2004-07-26 Thread Chris Martin
Justin Patrin wrote:
On Mon, 26 Jul 2004 11:27:32 +0300, EE [EMAIL PROTECTED] wrote:
What is this? I got this message few times from php.net...

Well, that's weirdI've never seen that one.
Apparently they're from an annoying spam service that someone on this 
list has subscribed to and not actually from the list itself.

They seem to have caused quite a disturbance on a few lists recently. 
Safe to ignore, setup a filter, and delete.

- Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: using the mssql functions on a linux server

2004-07-24 Thread Chris Martin
Skippy wrote:
On Mon, 12 Jul 2004 14:54:15 -0400 [EMAIL PROTECTED] (Edward Peloke) wrote:
Is this the only way around it?  Can I get to mssql without using the mssql
extension?

I don't think so. Plus, the entire setup is a bit complicated and you need
FreeTDS as well as UnixODBC installed, plus some /etc configuration magic.
FWIW, I have an article on the subject. It's in Romanian, but the commands,
configuration files and testing PHP code are clearly marked and are of course
universal, so perhaps you can make do with just some copypaste.
See here:
http://rowd.zuavra.net/articole/11/p2/
P.S.: If anyone wishes to put an English version on their site please contact
me in private. I'll take the time to translate it. I haven't put the English
version on the Web myself since my site is meant to be in Romanian only.
A bit late, but for future reference, I have an English translation of 
this article available at:
http://www.chriscodes.com/articles/Connecting_to_MSSQL_from_PHP_under_Linux/

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: exec works with some, but not all commands

2004-07-24 Thread Chris Martin
Matthew Sims wrote:
why would exec(touch /var/www/testfile.txt) work but not
exec(/usr/bin/gpg --homedir /home/testuser/.gnupg blah blah blah)
the dir used in homedir has mode 777 just for testing
this is the actual command I'm trying to run...
exec(/usr/bin/gpg --homedir /home/testdir/.gnupg --armor --output e.gpg
-e -r uid_someuser sf.txt);
if I run it from the command line, it works fine...

I'm not sure but what if you defined an absolute path for your output
files (e.gpg and sf.txt).
I'm not sure either, but I was thinking absolute too.
Also you might try system(), shell_exec(), or passthru() if you're 
trying to get output back.

--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Possible to Google search the news.php.net past post with keywords???

2004-06-09 Thread Chris Martin
Scott Fletcher wrote:
I'm wondering if it is possible to use Google search to search in hte
news.php.net's past posting by using the keyword.  If so, then how can it be
done?  Example of keywords.  Etc..
Thanks,
 FletchSOD
Although this isn't google, you can search the lists (and many others) 
through Gmane.
http://news.gmane.org/index.php?prefix=gmane.comp.php

--
Chris Martin - Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Error Downloading files using FOpen

2004-06-05 Thread Chris Martin
Gerald Winkler wrote:
snip
The code for the fopen is specifying a binary d/l and not ASCII so it 
shouldn't be doing this...
/snip
...Or should it?..
snip
Oh, it was originally tested using some .xls files, but a few .txt files I
created as a test were altered in the d/l as well...
/snip
It works with the .xls files, but not with the .txt file correct?
.xls files are binary, .txt files are ASCII
To open the .txt file try one of these instead
$fd = fopen($filepath,'r');
or
$fd = fopen($filepath,'rt');
Of course another infamous snip from the manual...
http://www.php.net/fopen
snip
The default translation mode depends on the SAPI and version of PHP that 
you are using, so you are encouraged to always specify the appropriate 
flag for portability reasons. You should use the 't'  mode if you are 
working with plain-text files and you use \n to delimit your line 
endings in your script, but expect your files to be readable with 
applications such as notepad. You should use the 'b' in all other cases.
/snip

Hope that helps. Sorry if I misunderstood your problem.
--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php