[PHP] ZIP

2004-09-14 Thread Juan Pablo Herrera
HI!
I need catch many files in my server and make a zip file. In pear i not
see nothing. I think use exec for contruction a zip file. Any idea?
Regards,
JP

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



[PHP] Zip file

2001-01-22 Thread Wade Halsey

Hi 

Does anyone know how to create a .zip file using php?
Thanks in advance!

Wade 



[PHP] Zip support

2001-05-08 Thread E. Stuart Hicks

I see that there is support for bzip2 and gzip in PHP, so I was wondering if
there was any standard zip support that I'm not seeing.

Stuart Hicks
Senior Programmer / Systems Administrator
The Affinity Group



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] zip extract

2002-04-12 Thread Plamen Slavov

Hi guys,
anyone has an idea about how to extract a zip file on win2k with php
i can not use a command line unzip utility because it only says "The system cannot 
execute the specified program." in the apache log
I tried to use pclszip class at http://www.phpconcept.net but i can not get it to work
I would appreciate any ideas
thanks



[PHP] Zip Problem

2002-07-08 Thread Mathew Joseph

Hi There,
I am trying to incorporate zipping and unzipping files on a windows 
platform via PHP. I came across  ZZiplib but wasnt able to find any 
information with regard to windows installation. Is there anyone who has 
tried something similar ?
   If yes, could you give me installation details and if possible a DLL 
which works on the windows platform.
thanks in advance,
Mathew


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




[PHP] ZIP Files?

2001-11-25 Thread Emiliano Marmonti




Hi people,
 
    I´m looking for alternatives in 
using zip files. Our users should upload into our server zipped files and we 
need to unzip this files and process it. I have read there is a library that 
could be used like an extension, but I´ve tried to use it from NT and don´t 
seems like the extension was added and when I try to use the commands PHP says 
that don´t recognoice the commands. In the other hand somebody has told me that 
PHP must be recompiled for using this library. Our platform is Windows NT but in 
the future could be Solaris.
 
    Anybody could send me your 
experience?
 
    Thanks in advance.
    
Emiliano

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] Zip Search

2010-04-15 Thread Jack
Hello All,

 

Can anyone recommend a good open source zip code search application and
database?

 

 

Thanks,

 

Jack

 



[PHP] ZIP extension

2003-02-21 Thread Torakiki
In the ZIP extension, is plan to add a kind of zip_entry_crc32() whitch
return the crc32's entry?

>> Paolo




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




[PHP] Zip library

2003-09-17 Thread Stéphane Paquay
Hi all,

I need to unzip a file on a linux server automatically.

I found the ZZiplib being able to do this but I don't know how to configure
PHP to handle it.

I use PHP 4.2.2.

Thanks in advance,

Stephane.

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



[PHP] zip problem

2004-02-16 Thread marc serra
Hi,

 

I want to know if it's possible to extract a zip file in PHP. 

 

I've read php documentation on ZZIPlib but i don't find any solution to
extract file.

 

Can you please help me to solve it.

 

Thx in advance,

 

Marc



Re: [PHP] ZIP

2004-09-14 Thread Fernando Gutierrez
searching in php.net   i found this...

http://www.zend.com/zend/spotlight/creating-zip-files1.php


On Tue, 14 Sep 2004 12:11:23 -0300 (ART), Juan Pablo Herrera
<[EMAIL PROTECTED]> wrote:
> HI!
> I need catch many files in my server and make a zip file. In pear i not
> see nothing. I think use exec for contruction a zip file. Any idea?
> Regards,
> JP
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



-- 
-- Fernando Gutierrez Perez --
gmeileando un poco :)

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



Re: [PHP] ZIP

2004-09-14 Thread Marek Kilimajer
Juan Pablo Herrera wrote:
HI!
I need catch many files in my server and make a zip file. In pear i not
see nothing. I think use exec for contruction a zip file. Any idea?
Regards,
JP
There are some classes (not in pear) that can create zip files w/out any 
special extension. google for "php zip class" or something like that

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


[PHP] Zip Codes

2004-11-04 Thread bb9876
Is there any way to use PHP to determine the zip code someone is visiting
from, assuming they are all from the US?

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



Re: [PHP] Zip file

2001-01-22 Thread Richard Lynch

>Does anyone know how to create a .zip file using php?

H.   Not sure if gzip can handle .zip file per se, or if .gz file is
okay for what you need, but try here:

http://php.net/manual/en/ref.zlib.php


If not, there's probably some software out there somewhere that runs on
Linux that could be exec()ed to create a zip file.

If you are on Windows, I think the exec() stuff may or may not work
depending on a whole host of factors, such as PHP version, which Win version
you're on, ... Or maybe it just never worked...

But, if you could get exec() to work on your box, you could probably find a
command-line interface to a zip archive package somewhere.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Zip support

2001-05-08 Thread Tom Carter

On Tue, 8 May 2001, E. Stuart Hicks wrote:

> I see that there is support for bzip2 and gzip in PHP, so I was wondering if
> there was any standard zip support that I'm not seeing.
>
I looked and couldn't find any. The best I could find to be able to zip
unzip files was to save them on the server and use exec() to run zip on
the command line to read the files back into php. Not the best way I know,
but it worked.

HTH,
Tom
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Zip support

2001-05-08 Thread E. Stuart Hicks

Yeah, that's what I wanted to avoid, though.  These scripts have to be able
to run on both NT and Unix boxes.  I guess I'll just have to change the
other code to use gzip instead of regular zip.

"Tom Carter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Tue, 8 May 2001, E. Stuart Hicks wrote:
>
> > I see that there is support for bzip2 and gzip in PHP, so I was
wondering if
> > there was any standard zip support that I'm not seeing.
> >
> I looked and couldn't find any. The best I could find to be able to zip
> unzip files was to save them on the server and use exec() to run zip on
> the command line to read the files back into php. Not the best way I know,
> but it worked.
>
> HTH,
> Tom
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Zip support

2001-05-08 Thread Wandrer

At 10:55 AM 5/8/01 -0400, you wrote:
>I see that there is support for bzip2 and gzip in PHP, so I was wondering if
>there was any standard zip support that I'm not seeing.
>Stuart Hicks
>Senior Programmer / Systems Administrator
>The Affinity Group

PhpZip 1.5 : http://phpconcept.free.fr/phpzip-index.php3



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] zip/zziplib segfaults

2002-09-24 Thread Charles Galpin

Hi 

I've searched the archives but cannot find any answers to this problem.

Red Hat 7.2
php-4.1.2-7.2.4 or php-4.1.2-7.3.4
zziplib-0.10.66

I rebuilt php with --with-zip. However a simple cli test program that
does a zip_open then attempts a zip_read, gets a segmentation fault on
the zip_read (or even a zip_close immediately after the open).

Can anyone shed some light on how to get zip support working?

I'm working on getting a backtrace right now.

thanks
charles



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




[PHP] ZIP/STORE LOCATOR

2002-04-25 Thread Andras Kende

Hello All,

I looking for a php ZIP/STORE LOCATOR for website..

Anyone knows where to look??


Thanks,

Andras Kende



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




[PHP] Zip Code Locator?

2001-07-23 Thread Vincent P. Cocciolone

Hi,

Does anyone know where can I find documentation or example scripts for a zip code 
locator. I'm looking for something that will list
other zip codes within a number of miles radius of the zip specified.

Thanks!

Vince


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Zip Search

2010-04-15 Thread Nathan Nobbe
On Thu, Apr 15, 2010 at 1:21 PM, Jack  wrote:

> Hello All,
>
> Can anyone recommend a good open source zip code search application and
> database?
>

depends on what you want, u.s., canada & mexico are pretty easy to find but
for other non domestic countries if you find something good feel free to
share :)

for a nice freebie that works on u.s. locations, snag the geoip extension
from pecl -

http://php.net/manual/en/book.geoip.php

-nathan


RE: [PHP] Zip Search

2010-04-15 Thread Tommy Pham
> -Original Message-
> From: Nathan Nobbe [mailto:quickshif...@gmail.com]
> Sent: Thursday, April 15, 2010 12:41 PM
> To: Jack
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Zip Search
> 
> On Thu, Apr 15, 2010 at 1:21 PM, Jack  wrote:
> 
> > Hello All,
> >
> > Can anyone recommend a good open source zip code search application
> and
> > database?
> >
> 
> depends on what you want, u.s., canada & mexico are pretty easy to find
> but
> for other non domestic countries if you find something good feel free
> to
> share :)
> 
> for a nice freebie that works on u.s. locations, snag the geoip
> extension
> from pecl -
> 
> http://php.net/manual/en/book.geoip.php
> 
> -nathan

IIRC, geoip is lookup based on host name or IP address for country, region, 
city, etc... similar to whois for DNS.  I think the OP wants to look geographic 
information, such as city, county, state/province, etc..., based on a given zip 
code like 92723.

Regards,
Tommy


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



Re: [PHP] Zip Search

2010-04-15 Thread Nathan Nobbe
On Thu, Apr 15, 2010 at 1:51 PM, Tommy Pham  wrote:

> > -Original Message-
> > From: Nathan Nobbe [mailto:quickshif...@gmail.com]
> > Sent: Thursday, April 15, 2010 12:41 PM
> > To: Jack
> > Cc: php-general@lists.php.net
> > Subject: Re: [PHP] Zip Search
> >
> > On Thu, Apr 15, 2010 at 1:21 PM, Jack  wrote:
> >
> > > Hello All,
> > >
> > > Can anyone recommend a good open source zip code search application
> > and
> > > database?
> > >
> >
> > depends on what you want, u.s., canada & mexico are pretty easy to find
> > but
> > for other non domestic countries if you find something good feel free
> > to
> > share :)
> >
> > for a nice freebie that works on u.s. locations, snag the geoip
> > extension
> > from pecl -
> >
> > http://php.net/manual/en/book.geoip.php
> >
> > -nathan
>
> IIRC, geoip is lookup based on host name or IP address for country, region,
> city, etc... similar to whois for DNS.  I think the OP wants to look
> geographic information, such as city, county, state/province, etc..., based
> on a given zip code like 92723.
>

ahh, perhaps a hasty reply on my part - heres a nice freebie mentioned by
geoip -

http://geocoder.ibegin.com/downloads.php

-nathan


Re: [PHP] Zip Search

2010-04-15 Thread Jason Pruim


On Apr 15, 2010, at 3:21 PM, Jack wrote:


Hello All,



Can anyone recommend a good open source zip code search application  
and

database?


If it's us zip's you want... I'd go straight to the source... 
http://www.usps.com/zip4/welcome.htm?from=home_header&page=findazipcode

The post office also does have API's for hooking into it if you can  
handle the restrictions since they are the government :)


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



Re: [PHP] Zip Search

2010-04-16 Thread tedd

At 3:21 PM -0400 4/15/10, Jack wrote:

Hello All,

Can anyone recommend a good open source zip code search application and
database?

Thanks,

Jack


Do you mean something like this:

http://php1.net/b/zipcode/

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] ZIP it :o)

2007-05-31 Thread Auto-Deppe, C. Haensel

Morning guys,

I have been trying to find an easy to use way to zip an archive on a linux
box running PHP5. Now I've tried the zip-lib.php and others, but they always
throw an error msg But that is not the question.

I am looking to use exec("zip archive.zip $directory");  $directory has been
tried with both full path and relative path ... but that doesn't work. I
don't get an error, it just doesn't create the zip-file...

So, after a day of Google-ing and trying, I thought I might ask you for
help.

Cheers for any answers and hints.

Regards,

Chris

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



[PHP] PHP Zip Question

2006-10-24 Thread Matt Street
Dear all,

I am trying to create a zipping mechanism that allows the user to select a
number of files from a list; these files are then zipped and downloaded to
the user's machine. I presently have:

$zip = new ZipArchive();
$filename = $zipfinalpath."tutor/zipfiles/".$tutorzipfile;

if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
exit("cannot open <$filename> \n");
}
else {
$loopCount = 0;
foreach ($filelisttozip as $i => $fileValue) {  
//the 
$zip->addFile($fileValue,$filenamelisttozip[$loopCount]);
$loopCount ++;
}
}

$zip->close();

In my test sample of files I have the following file types:

.doc
.zip
.jpg
.doc

And the zip mechanism works when I ask for all or omit any of the files from
the list, except when I omit the zip file! E.g.

1. Asking for all works
2. Asking for .zip,.jpg,.doc works
3. Asking for .doc,.zip works
4. Asking for .doc,.jpg,.doc doesn't work - 7-zip tells me that the file is
not support archive and windows tells me the Compressed(folder) is invalid
or corrupted!

I have used different zip files to make sure that it's not the file, but all
to no avail. . .but if I add:

$zip = zip_open($filename);
while ($zip_entry = zip_read($zip)) {
  $file = basename(zip_entry_name($zip_entry));

echo 'a'.$file.'';
}
zip_close($zip);

to the bottom of my page it correctly displays, on screen, the 3 files I
expect to be in the zip file.

Any help would be very gratefully received as this is driving me mad!!!

Matt

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



Re: [PHP] Zip library

2003-09-17 Thread Jason Wong
On Wednesday 17 September 2003 16:38, St�hane Paquay wrote:

> I need to unzip a file on a linux server automatically.
>
> I found the ZZiplib being able to do this but I don't know how to configure
> PHP to handle it.

You need to recompile php adding 

  --with-zip[=DIR]

If you don't know how to do this then read manual > Installation. Or search 
out some tutorials.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Life is like an onion: you peel off layer after layer and then you find
there is nothing in it.
-- James Huneker
*/

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



Re: [PHP] Zip library

2003-09-17 Thread Marek Kilimajer
There are also pure php classes that can handle zip files, for example 
http://www.phpconcept.net/pclzip/index.en.php

Stéphane Paquay wrote:

Hi all,

I need to unzip a file on a linux server automatically.

I found the ZZiplib being able to do this but I don't know how to configure
PHP to handle it.
I use PHP 4.2.2.

Thanks in advance,

Stephane.

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


[PHP] Zip to postcode

2003-04-02 Thread Andy
Can someone please tell me how i change the following code:
if (!ereg("^[0-9]{5,5}(\-[0-9]{4,4})?$",$postcode))

to a UK postcode QQ1 1QQ
When i fill out the form it tells me that the postcode is not valid and i
think it is because it is in zip code format.

Thank you

Andy



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



Re: [PHP] zip problem

2004-02-17 Thread Jason Wong
On Tuesday 17 February 2004 03:28, marc serra wrote:

> I want to know if it's possible to extract a zip file in PHP.
>
> I've read php documentation on ZZIPlib but i don't find any solution to
> extract file.
>
> Can you please help me to solve it.

The example in the manual shows how to open a zip archive and read each file 
into memory and display. It should be a straight forward matter to use the 
functions in "Filesystem functions" to write the uncompressed files to disk.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If it seems too good to be true, it probably is
-- Murphy's Love Laws n10
*/

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



RE: [PHP] Zip Codes

2004-11-04 Thread Vail, Warren
Do you mean other than asking them, like using their IP address?

Warren Vail

-Original Message-
From: bb9876 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 9:00 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Zip Codes


Is there any way to use PHP to determine the zip code someone is visiting
from, assuming they are all from the US?

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

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



RE: [PHP] Zip Codes

2004-11-04 Thread Jay Blanchard
[snip]
Is there any way to use PHP to determine the zip code someone is
visiting
from, assuming they are all from the US?
[/snip]

You would have to determine their IP, which, some being dynamically
assigned at log on, would not necessarily indicate the users location.
Then you would have to be able to map the IP to a zip code. The short
answer is no.

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



Re: [PHP] Zip Codes

2004-11-04 Thread Greg Donald
On Thu, 4 Nov 2004 08:59:50 -0800, bb9876 <[EMAIL PROTECTED]> wrote:
> Is there any way to use PHP to determine the zip code someone is visiting
> from, assuming they are all from the US?

http://www.usps.com/webtools/


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Zip Codes

2004-11-04 Thread John Nichel
bb9876 wrote:
Is there any way to use PHP to determine the zip code someone is visiting
from, assuming they are all from the US?
Outside of asking the visitor for it, no.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Zip Codes

2004-11-04 Thread Jason Wong
On Thursday 04 November 2004 16:59, bb9876 wrote:
> Is there any way to use PHP to determine the zip code someone is visiting
> from, assuming they are all from the US?

Something like this should work:

-- start

Please input zipcode 




-- end

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Thinking you know something is a sure way to blind yourself.
  -- Frank Herbert, "Chapterhouse: Dune"
*/

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



Re: [PHP] Zip Codes

2004-11-04 Thread bb9876
Okay, I run a movie news site and wanted to use it to make it even quicker
for users to find movie times in their area whether they were logged in or
not, but that's the way it goes.

Thanks fo rthe replies.


"John Nichel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> bb9876 wrote:
> > Is there any way to use PHP to determine the zip code someone is
visiting
> > from, assuming they are all from the US?
> >
>
> Outside of asking the visitor for it, no.
>
> -- 
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]

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



Re: [PHP] Zip Codes

2004-11-04 Thread Matthew Weier O'Phinney
* Bb9876 <[EMAIL PROTECTED]>:
> "John Nichel" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > bb9876 wrote:
> > > Is there any way to use PHP to determine the zip code someone is
> > > visiting
> > > from, assuming they are all from the US?
> > >
> >
> > Outside of asking the visitor for it, no.
> 
> Okay, I run a movie news site and wanted to use it to make it even
> quicker for users to find movie times in their area whether they were
> logged in or not, but that's the way it goes.

Well, you *could* have a form that displays asking for their zip code;
on submission, it sets a cookie with their zip code, and this allows
them to see their personalized movie times on subsequent visits. (You
could even hide the zipcode form if the cookie is set)

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



Re: [PHP] Zip Codes

2004-11-04 Thread bb9876
Thanks for the sarcasm, it definitely helps.

Why is it that when people ask a question there is always someone that has a
smartass answer?

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Thursday 04 November 2004 16:59, bb9876 wrote:
> > Is there any way to use PHP to determine the zip code someone is
visiting
> > from, assuming they are all from the US?
>
> Something like this should work:
>
> -- start
> 
> Please input zipcode 
> 
> 
>
>if (!empty($_POST['zipcode'])) {
> echo "Whoa! your zipcode is {$_POST['zipcode']}";
>   }
> ?>
> -- end
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Thinking you know something is a sure way to blind yourself.
>   -- Frank Herbert, "Chapterhouse: Dune"
> */

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



RE: [PHP] Zip Codes

2004-11-04 Thread Vail, Warren
One thing I might be tempted to try would be to execute a trace route
utility and analyze the output, but it is very cryptic;

http://www.traceroute.org/
http://www.tracert.com/cgi-bin/trace.pl

HOSTLOSS  RCVD SENTBEST AVG
WORST
er1.sfo1.speakeasy.net0%20   20   25.70   30.68
89.13
220.ge-0-1-0.cr2.sfo1.speakeasy.net   0%20   20   24.02   26.56
58.23
ge-4-0-440.ipcolo1.SanJose1.Level3.net0%20   20   24.38   25.28
27.09
ae-1-56.bbr2.SanJose1.Level3.net  0%20   20   24.26   31.00
97.58
so-3-0-0.mp1.SanFrancisco1.Level3.net 0%20   20   25.49   28.89
49.58
so-10-0.ipcolo1.SanFranciso1.Level3.net   0%20   20   25.17   25.81
26.73
gw-level3-sfo.internap.com0%20   20   27.32   28.12
29.58
border4.ge3-0-bbnet2.sfo.pnap.net 0%20   20   27.11   28.24
28.93
??? 100% 0   200.000.00
0.00

If you can figure out how to make sense of this, you might be able to find
the point that a system is connected to the internet, by tracing back to a
visitors current IP address.

If you come up with something useful, keep the list informed.

Warren Vail


-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 9:22 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Zip Codes


bb9876 wrote:
> Is there any way to use PHP to determine the zip code someone is 
> visiting from, assuming they are all from the US?
> 

Outside of asking the visitor for it, no.

-- 
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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

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



RE: [PHP] Zip Codes

2004-11-04 Thread Vail, Warren
Because for some of us, that part of our body is the smartest thing we have
going, and the rest of us is not engaged in the question.

Warren Vail

-Original Message-
From: bb9876 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 9:41 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Zip Codes


Thanks for the sarcasm, it definitely helps.

Why is it that when people ask a question there is always someone that has a
smartass answer?

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Thursday 04 November 2004 16:59, bb9876 wrote:
> > Is there any way to use PHP to determine the zip code someone is
visiting
> > from, assuming they are all from the US?
>
> Something like this should work:
>
> -- start
>  
> Please input zipcode  
>  
>
>if (!empty($_POST['zipcode'])) {
> echo "Whoa! your zipcode is {$_POST['zipcode']}";
>   }
> ?>
> -- end
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Thinking you know something is a sure way to blind yourself.
>   -- Frank Herbert, "Chapterhouse: Dune"
> */

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

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



Re: [PHP] Zip Codes

2004-11-04 Thread Matthew Sims
> Thanks for the sarcasm, it definitely helps.
>
> Why is it that when people ask a question there is always someone that has
> a smartass answer?
>

It keeps us on our toes. Someone's gotta do it.

-- 
--Matthew Sims
--

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



RE: [PHP] Zip Codes

2004-11-04 Thread Jay Blanchard
[snip]
> Thanks for the sarcasm, it definitely helps.
>
> Why is it that when people ask a question there is always someone that
has
> a smartass answer?
>

It keeps us on our toes. Someone's gotta do it.
[/snip]

It would be a terrible thing to arrive one day, open the list, and see
that everyone had been civil...no sarcasm, no witjust business. BTW
thanks for the heads up on that USPS API

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



RE: [PHP] Zip Codes

2004-11-04 Thread Brian V Bonini
On Thu, 2004-11-04 at 12:47, Vail, Warren wrote:

> If you can figure out how to make sense of this, you might be able to find
> the point that a system is connected to the internet, by tracing back to a
> visitors current IP address.

Which may get you close but either way would probably be more indicative
of the service providers location then the actual user and even
narrowing it down to a single city does not mean you have only a single
zip code to deal with.

-- 

s/:-[(/]/:-)/g


BrianGnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org
aGEhIGJldCB5b3UgdGhpbmsgeW91IHByZXR0eSBzbGljayBmb3IgZmlndXJpbmcgb3V0I
GhvdyB0byBkZWNvZGUgdGhpcy4gVG9vIGJhZCBpdCBoYXMgbm8gc2VjcmV0IGluZm8gaW
4gaXQgaGV5Pwo=

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



Re: [PHP] Zip Codes

2004-11-04 Thread Dusty Bin
Brian V Bonini wrote:
On Thu, 2004-11-04 at 12:47, Vail, Warren wrote:

If you can figure out how to make sense of this, you might be able to find
the point that a system is connected to the internet, by tracing back to a
visitors current IP address.

Which may get you close but either way would probably be more indicative
of the service providers location then the actual user and even
narrowing it down to a single city does not mean you have only a single
zip code to deal with.
not to mention DHCP!!!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] ZIP combinaton in PHP?

2002-06-30 Thread Tony Harrison

I realise its a longshot but is it possible to use PHP (or any other
web-based languages) to combine multiple ZIP files into a single ZIP file?
and any scripts i can download to do it.

Any help with this is most appreciated. ;-)



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




Re: [PHP] Zip Code Locator?

2001-07-24 Thread Ben Bleything

You could write your own. . .

Just kidding... well, technically you could... but... that's not the
point.

http://sourceforge.net/projects/zipcodedb has a "Raw ZIP code dump"... It
has a little more data than just zip, city, state... I don't know what it
means, but maybe you would...

Sorry, it's the best I could do =>

Ben

On Mon, 23 Jul 2001, Vincent P. Cocciolone wrote:

> Hi,
>
> Does anyone know where can I find documentation or example scripts for a zip code 
>locator. I'm looking for something that will list
> other zip codes within a number of miles radius of the zip specified.
>
> Thanks!
>
> Vince
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Zip Code Locator?

2001-07-24 Thread Matthew Loff


Ben--

Thanks for pointing that out... I've been looking for info like that for
a long time! 

Much appreciated.

--Matt


-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 24, 2001 1:23 PM
To: Vincent P. Cocciolone
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Zip Code Locator?


You could write your own. . .

Just kidding... well, technically you could... but... that's not the
point.

http://sourceforge.net/projects/zipcodedb has a "Raw ZIP code dump"...
It has a little more data than just zip, city, state... I don't know
what it means, but maybe you would...

Sorry, it's the best I could do =>

Ben

On Mon, 23 Jul 2001, Vincent P. Cocciolone wrote:

> Hi,
>
> Does anyone know where can I find documentation or example scripts for

> a zip code locator. I'm looking for something that will list other zip

> codes within a number of miles radius of the zip specified.
>
> Thanks!
>
> Vince
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] To 
> contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Zip Code Locator?

2001-07-24 Thread Benjamin Bleything

Hey, let me know if you figure out what the extra numbers are for... I might 
have a use for this at some point.

Ben

>From: "Matthew Loff" <[EMAIL PROTECTED]>
>To: "'Ben Bleything'" <[EMAIL PROTECTED]>, "'Vincent P. Cocciolone'" 
<[EMAIL PROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Subject: RE: [PHP] Zip Code Locator?
>Date: Tue, 24 Jul 2001 16:40:01 -0400
>MIME-Version: 1.0
>Content-Transfer-Encoding: 7bit
>X-Priority: 3 (Normal)
>X-MSMail-Priority: Normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.
>Importance: Normal
>
>
>Ben--
>
>Thanks for pointing that out... I've been looking for info like that for
>a long time! 
>
>Much appreciated.
>
>--Matt
>
>
>-Original Message-
>From: Ben Bleything [mailto:[EMAIL PROTECTED]] 
>Sent: Tuesday, July 24, 2001 1:23 PM
>To: Vincent P. Cocciolone
>Cc: [EMAIL PROTECTED]
>Subject: Re: [PHP] Zip Code Locator?
>
>
>You could write your own. . .
>
>Just kidding... well, technically you could... but... that's not the
>point.
>
>http://sourceforge.net/projects/zipcodedb has a "Raw ZIP code dump"...
>It has a little more data than just zip, city, state... I don't know
>what it means, but maybe you would...
>
>Sorry, it's the best I could do =>
>
>Ben
>
>On Mon, 23 Jul 2001, Vincent P. Cocciolone wrote:
>
>> Hi,
>>
>> Does anyone know where can I find documentation or example scripts for
>
>> a zip code locator. I'm looking for something that will list other zip
>
>> codes within a number of miles radius of the zip specified.
>>
>> Thanks!
>>
>> Vince
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED] To 
>> contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED] To
>contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Zip Code Locator?

2001-07-24 Thread Kurth Bemis

At 04:42 PM 7/24/2001, Benjamin Bleything wrote:

i'm pretty sure that the extra numbers are coord of that town.  you know 
the long and lat.

~kurth


>Hey, let me know if you figure out what the extra numbers are for... I might
>have a use for this at some point.
>
>Ben
>
> >From: "Matthew Loff" <[EMAIL PROTECTED]>
> >To: "'Ben Bleything'" <[EMAIL PROTECTED]>, "'Vincent P. Cocciolone'"
><[EMAIL PROTECTED]>
> >Cc: <[EMAIL PROTECTED]>
> >Subject: RE: [PHP] Zip Code Locator?
> >Date: Tue, 24 Jul 2001 16:40:01 -0400
> >MIME-Version: 1.0
> >Content-Transfer-Encoding: 7bit
> >X-Priority: 3 (Normal)
> >X-MSMail-Priority: Normal
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.
> >Importance: Normal
> >
> >
> >Ben--
> >
> >Thanks for pointing that out... I've been looking for info like that for
> >a long time!
> >
> >Much appreciated.
> >
> >--Matt
> >
> >
> >-Original Message-
> >From: Ben Bleything [mailto:[EMAIL PROTECTED]]
> >Sent: Tuesday, July 24, 2001 1:23 PM
> >To: Vincent P. Cocciolone
> >Cc: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Zip Code Locator?
> >
> >
> >You could write your own. . .
> >
> >Just kidding... well, technically you could... but... that's not the
> >point.
> >
> >http://sourceforge.net/projects/zipcodedb has a "Raw ZIP code dump"...
> >It has a little more data than just zip, city, state... I don't know
> >what it means, but maybe you would...
> >
> >Sorry, it's the best I could do =>
> >
> >Ben
> >
> >On Mon, 23 Jul 2001, Vincent P. Cocciolone wrote:
> >
> >> Hi,
> >>
> >> Does anyone know where can I find documentation or example scripts for
> >
> >> a zip code locator. I'm looking for something that will list other zip
> >
> >> codes within a number of miles radius of the zip specified.
> >>
> >> Thanks!
> >>
> >> Vince
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED] To
> >> contact the list administrators, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED] To
> >contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Zip Code Locator?

2001-07-24 Thread Justin Farnsworth

Kurth Bemis wrote:
> 
> At 04:42 PM 7/24/2001, Benjamin Bleything wrote:
> 
> i'm pretty sure that the extra numbers are coord of that town.  you know
> the long and lat.
[== snip, snip ==]

FWIW, here is the formula needed, here just a snippet getting the
distance between two ZIP's, and, yes, Virginia, you have to
have the latitude and longitude in radians:

#== construct the computed distance field (artificial field) ==
$dist   = "(ACOS(SIN($this->LAST_LAT) * ";
$dist   .= "SIN(LatRad) + ";
$dist   .= "COS($this->LAST_LAT) * ";
$dist   .= "COS(LatRad) * ";
$dist   .= "COS(LongRad -$this->LAST_LONG)) *";
$dist   .= "3958.88012572)";

For this snippet, consider LAST_LAT and LAST_LONG the
"first point" in this spherical geometry solution, nicely all
done by MySQL.  But you can do the formula in PHP, if you
wish.

--
> > >On Mon, 23 Jul 2001, Vincent P. Cocciolone wrote:
> > >
> > >> Hi,
> > >>
> > >> Does anyone know where can I find documentation or example scripts for
> > >
> > >> a zip code locator. I'm looking for something that will list other zip
> > >
> > >> codes within a number of miles radius of the zip specified.
> > >>
> > >> Thanks!
> > >>
> > >> Vince

-- 
Justin Farnsworth
Eye Integrated Communications
321 South Evans - Suite 203
Greenville, NC 27858 | Tel: (252) 353-0722

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Zip Code Locator?

2001-07-25 Thread Brian Dunworth



> Hey, let me know if you figure out what the extra numbers are
> for... I might have a use for this at some point.

  The last two numbers are latitude and longitude of the registered zip code
center for the given zip code.


 ---
  Brian S. Dunworth
  Sr. Software Development Engineer
  Oracle Database Administrator
  The Printing House, Ltd.
  (850) 875-1500 x225
 ---



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ZIp files? Help needed...

2001-11-28 Thread Emiliano Marmonti

Hi people,

I´m looking for alternatives in using zip files. Our users should upload into our 
server zipped files and we need to unzip this files and process it. I have read there 
is a library that could be used like an extension, but I´ve tried to use it from NT 
and don´t seems like the extension was added and when I try to use the commands PHP 
says that don´t recognoice the commands. In the other hand somebody has told me that 
PHP must be recompiled for using this library. Our platform is Windows NT but in the 
future could be Solaris.

Anybody could send me your experience?




[PHP] zip and mac safari

2010-10-07 Thread M. Reuter
Hi,

does anyone know how to use a php script to zip a folder (with a
subfolder) so that safari can open it and not decompresses forever?

Thanks, Martin


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



Re: [PHP] ZIP it :o)

2007-05-31 Thread Stut

Auto-Deppe, C. Haensel wrote:

I have been trying to find an easy to use way to zip an archive on a linux
box running PHP5. Now I've tried the zip-lib.php and others, but they 
always

throw an error msg But that is not the question.

I am looking to use exec("zip archive.zip $directory");  $directory has 
been

tried with both full path and relative path ... but that doesn't work. I
don't get an error, it just doesn't create the zip-file...

So, after a day of Google-ing and trying, I thought I might ask you for
help.


Most likely a permissions problem. Does the PHP user have write access 
to the place where archive.zip will be created?


-Stut

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



Re: [PHP] ZIP it :o)

2007-05-31 Thread Jim Lucas

Auto-Deppe, C. Haensel wrote:

Morning guys,

I have been trying to find an easy to use way to zip an archive on a linux
box running PHP5. Now I've tried the zip-lib.php and others, but they 
always

throw an error msg But that is not the question.

I am looking to use exec("zip archive.zip $directory");  $directory has 
been

tried with both full path and relative path ... but that doesn't work. I
don't get an error, it just doesn't create the zip-file...

So, after a day of Google-ing and trying, I thought I might ask you for
help.

Cheers for any answers and hints.

Regards,

Chris



Read up on this page

http://us2.php.net/manual/en/function.exec.php

Then try this instead

&1", $output);

echo $output;

?>

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



Re: [PHP] ZIP it :o)

2007-05-31 Thread Chris

Auto-Deppe, C. Haensel wrote:

Morning guys,

I have been trying to find an easy to use way to zip an archive on a linux
box running PHP5. Now I've tried the zip-lib.php and others, but they 
always

throw an error msg But that is not the question.

I am looking to use exec("zip archive.zip $directory");  $directory has 
been

tried with both full path and relative path ... but that doesn't work. I
don't get an error, it just doesn't create the zip-file...

So, after a day of Google-ing and trying, I thought I might ask you for
help.

Cheers for any answers and hints.


http://pear.php.net/package/Archive_Zip and/or 
http://pear.php.net/package/File_Archive


and please create a *new* message instead of replying to an existing one 
and changing the topic. It screws up message threading (in email clients 
and in the archives).


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] ZIP it :o)

2007-06-01 Thread Tijnema

On 6/1/07, Chris <[EMAIL PROTECTED]> wrote:

Auto-Deppe, C. Haensel wrote:
> Morning guys,
>
> I have been trying to find an easy to use way to zip an archive on a linux
> box running PHP5. Now I've tried the zip-lib.php and others, but they
> always
> throw an error msg But that is not the question.
>
> I am looking to use exec("zip archive.zip $directory");  $directory has
> been
> tried with both full path and relative path ... but that doesn't work. I
> don't get an error, it just doesn't create the zip-file...
>
> So, after a day of Google-ing and trying, I thought I might ask you for
> help.
>
> Cheers for any answers and hints.

http://pear.php.net/package/Archive_Zip and/or
http://pear.php.net/package/File_Archive

and please create a *new* message instead of replying to an existing one
and changing the topic. It screws up message threading (in email clients
and in the archives).


Not in gmail :)

I had same problem lately, wanted also to create zip files from PHP, i
tried various build in functions, but i ended up with the exec way.
It has been said before, but PHP probably doesn't have the right
permissions to write the .zip file, so i would recommend you to write
to /tmp first.

Tijnema





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



Re: [PHP] ZIP it :o)

2007-06-01 Thread Auto-Deppe, C. Haensel

Hi guys,

thanks to Jim, I made it :o) Here's the source I'm using for testing now... 
it works. I just need to make it less vulnerable ;o)


- SNIP -
header('Content-Disposition: attachment; 
filename="Auto-Deppe-'.$now.'_Download.zip"');

exec("zip ".$now."_archive.zip temp/* 2>&1", $output);
readfile($now."_archive.zip");
$tempdir = opendir("temp");
while($tempfile = readdir($tempdir)) {
if(eregi("jpg", $tempfile)) {
 unlink("temp/".$tempfile);
}
}
?>
- SNAP -
So I am copying the files to a temp dir, and then zip em up, delete them 
afterwards. I copy them to the dir so I wouldn't have the whole 
/kfz_images/number/full/ structure in the zip).


Aaaanyhow, it works, it does work fast enough, and I am happy :o)

Thanks a bunch, guys, and have a great day!

This is Christian Haensel live from Extertal, Germany. Back to you.

-:oD)=


- Original Message - 
From: "Tijnema" <[EMAIL PROTECTED]>

To: "Chris" <[EMAIL PROTECTED]>
Cc: "Auto-Deppe, C. Haensel" <[EMAIL PROTECTED]>; 


Sent: Friday, June 01, 2007 9:27 AM
Subject: Re: [PHP] ZIP it :o)



On 6/1/07, Chris <[EMAIL PROTECTED]> wrote:

Auto-Deppe, C. Haensel wrote:
> Morning guys,
>
> I have been trying to find an easy to use way to zip an archive on a 
> linux

> box running PHP5. Now I've tried the zip-lib.php and others, but they
> always
> throw an error msg But that is not the question.
>
> I am looking to use exec("zip archive.zip $directory");  $directory has
> been
> tried with both full path and relative path ... but that doesn't work. 
> I

> don't get an error, it just doesn't create the zip-file...
>
> So, after a day of Google-ing and trying, I thought I might ask you for
> help.
>
> Cheers for any answers and hints.

http://pear.php.net/package/Archive_Zip and/or
http://pear.php.net/package/File_Archive

and please create a *new* message instead of replying to an existing one
and changing the topic. It screws up message threading (in email clients
and in the archives).


Not in gmail :)

I had same problem lately, wanted also to create zip files from PHP, i
tried various build in functions, but i ended up with the exec way.
It has been said before, but PHP probably doesn't have the right
permissions to write the .zip file, so i would recommend you to write
to /tmp first.

Tijnema







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



Re: [PHP] ZIP it :o)

2007-06-01 Thread Jim Lucas

Auto-Deppe, C. Haensel wrote:

Hi guys,

thanks to Jim, I made it :o) Here's the source I'm using for testing 
now... it works. I just need to make it less vulnerable ;o)


- SNIP -
header('Content-Disposition: attachment; 
filename="Auto-Deppe-'.$now.'_Download.zip"');

exec("zip ".$now."_archive.zip temp/* 2>&1", $output);
readfile($now."_archive.zip");
$tempdir = opendir("temp");
while($tempfile = readdir($tempdir)) {
if(eregi("jpg", $tempfile)) {
 unlink("temp/".$tempfile);
}
}
?>
- SNAP -
So I am copying the files to a temp dir, and then zip em up, delete them 
afterwards. I copy them to the dir so I wouldn't have the whole 
/kfz_images/number/full/ structure in the zip).


Aaaanyhow, it works, it does work fast enough, and I am happy :o)

Thanks a bunch, guys, and have a great day!

This is Christian Haensel live from Extertal, Germany. Back to you.

-:oD)=


- Original Message - From: "Tijnema" <[EMAIL PROTECTED]>
To: "Chris" <[EMAIL PROTECTED]>
Cc: "Auto-Deppe, C. Haensel" <[EMAIL PROTECTED]>; 


Sent: Friday, June 01, 2007 9:27 AM
Subject: Re: [PHP] ZIP it :o)



On 6/1/07, Chris <[EMAIL PROTECTED]> wrote:

Auto-Deppe, C. Haensel wrote:
> Morning guys,
>
> I have been trying to find an easy to use way to zip an archive on 
a > linux

> box running PHP5. Now I've tried the zip-lib.php and others, but they
> always
> throw an error msg But that is not the question.
>
> I am looking to use exec("zip archive.zip $directory");  $directory 
has

> been
> tried with both full path and relative path ... but that doesn't 
work. > I

> don't get an error, it just doesn't create the zip-file...
>
> So, after a day of Google-ing and trying, I thought I might ask you 
for

> help.
>
> Cheers for any answers and hints.

http://pear.php.net/package/Archive_Zip and/or
http://pear.php.net/package/File_Archive

and please create a *new* message instead of replying to an existing one
and changing the topic. It screws up message threading (in email clients
and in the archives).


Not in gmail :)

I had same problem lately, wanted also to create zip files from PHP, i
tried various build in functions, but i ended up with the exec way.
It has been said before, but PHP probably doesn't have the right
permissions to write the .zip file, so i would recommend you to write
to /tmp first.

Tijnema








Here's a link to the zip class that I use

http://www.phpclasses.org/browse/package/945.html

One thing though, your PHP install has to be compiled with "--with-zlib"

That was the only thing that I ran into with this.

Since you are creating files to download, with this class, you don't even need to write them to the 
filesystem.  You just create the archive in memory (given that you have enough RAM && php is allowed 
to consume as much memory as it would take the create the archive) and then dump it to the browser 
instead of using readfile().  You save the time/space/headaches of trying to write your zip file to 
the filesystem.




--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Unknown

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



Re: [PHP] ZIP it :o)

2007-06-01 Thread Tijnema

On 6/1/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

Auto-Deppe, C. Haensel wrote:
> Hi guys,
>
> thanks to Jim, I made it :o) Here's the source I'm using for testing
> now... it works. I just need to make it less vulnerable ;o)
>
> - SNIP -
>  $nr  = $_GET['nr'];
> if(eregi("../", $nr)) {
> die("Hier wird nicht rumgehackt");
> }
> $directory = '_kfz_images/'.$nr.'/full/';
> $dir = opendir($directory);
> $i = 1;
> while($file = readdir($dir)) {
> $dest = "temp/Auto-Deppe-".$nr."_".$i.".jpg";
> if(eregi("jpg", $file)) {
>  copy($directory.$file, $dest);
>  $i++;
> }
> }
> $now = time();
> header("Content-Type: application/force-download");
> header('Content-Disposition: attachment;
> filename="Auto-Deppe-'.$now.'_Download.zip"');
> exec("zip ".$now."_archive.zip temp/* 2>&1", $output);
> readfile($now."_archive.zip");
> $tempdir = opendir("temp");
> while($tempfile = readdir($tempdir)) {
> if(eregi("jpg", $tempfile)) {
>  unlink("temp/".$tempfile);
> }
> }
> ?>
> - SNAP -
> So I am copying the files to a temp dir, and then zip em up, delete them
> afterwards. I copy them to the dir so I wouldn't have the whole
> /kfz_images/number/full/ structure in the zip).
>
> Aaaanyhow, it works, it does work fast enough, and I am happy :o)
>
> Thanks a bunch, guys, and have a great day!
>
> This is Christian Haensel live from Extertal, Germany. Back to you.
>
> -:oD)=
>
>
> - Original Message - From: "Tijnema" <[EMAIL PROTECTED]>
> To: "Chris" <[EMAIL PROTECTED]>
> Cc: "Auto-Deppe, C. Haensel" <[EMAIL PROTECTED]>;
> 
> Sent: Friday, June 01, 2007 9:27 AM
> Subject: Re: [PHP] ZIP it :o)
>
>
>> On 6/1/07, Chris <[EMAIL PROTECTED]> wrote:
>>> Auto-Deppe, C. Haensel wrote:
>>> > Morning guys,
>>> >
>>> > I have been trying to find an easy to use way to zip an archive on
>>> a > linux
>>> > box running PHP5. Now I've tried the zip-lib.php and others, but they
>>> > always
>>> > throw an error msg But that is not the question.
>>> >
>>> > I am looking to use exec("zip archive.zip $directory");  $directory
>>> has
>>> > been
>>> > tried with both full path and relative path ... but that doesn't
>>> work. > I
>>> > don't get an error, it just doesn't create the zip-file...
>>> >
>>> > So, after a day of Google-ing and trying, I thought I might ask you
>>> for
>>> > help.
>>> >
>>> > Cheers for any answers and hints.
>>>
>>> http://pear.php.net/package/Archive_Zip and/or
>>> http://pear.php.net/package/File_Archive
>>>
>>> and please create a *new* message instead of replying to an existing one
>>> and changing the topic. It screws up message threading (in email clients
>>> and in the archives).
>>
>> Not in gmail :)
>>
>> I had same problem lately, wanted also to create zip files from PHP, i
>> tried various build in functions, but i ended up with the exec way.
>> It has been said before, but PHP probably doesn't have the right
>> permissions to write the .zip file, so i would recommend you to write
>> to /tmp first.
>>
>> Tijnema
>>
>>>
>>
>
Here's a link to the zip class that I use

http://www.phpclasses.org/browse/package/945.html

One thing though, your PHP install has to be compiled with "--with-zlib"

That was the only thing that I ran into with this.

Since you are creating files to download, with this class, you don't even need 
to write them to the
filesystem.  You just create the archive in memory (given that you have enough RAM 
&& php is allowed
to consume as much memory as it would take the create the archive) and then 
dump it to the browser

Yes, but what happens when you try to create a 1GB archive with 512MB
RAM? (and no swap space too)
or if 100s of people call the same script that creates a 10-20MB file?
If you use the exec way, this will go fine :)

Tijnema

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



Re: [PHP] ZIP it :o)

2007-06-01 Thread Jim Lucas

Tijnema wrote:

On 6/1/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

Auto-Deppe, C. Haensel wrote:
> Hi guys,
>
> thanks to Jim, I made it :o) Here's the source I'm using for testing
> now... it works. I just need to make it less vulnerable ;o)
>
> - SNIP -
>  $nr  = $_GET['nr'];
> if(eregi("../", $nr)) {
> die("Hier wird nicht rumgehackt");
> }
> $directory = '_kfz_images/'.$nr.'/full/';
> $dir = opendir($directory);
> $i = 1;
> while($file = readdir($dir)) {
> $dest = "temp/Auto-Deppe-".$nr."_".$i.".jpg";
> if(eregi("jpg", $file)) {
>  copy($directory.$file, $dest);
>  $i++;
> }
> }
> $now = time();
> header("Content-Type: application/force-download");
> header('Content-Disposition: attachment;
> filename="Auto-Deppe-'.$now.'_Download.zip"');
> exec("zip ".$now."_archive.zip temp/* 2>&1", $output);
> readfile($now."_archive.zip");
> $tempdir = opendir("temp");
> while($tempfile = readdir($tempdir)) {
> if(eregi("jpg", $tempfile)) {
>  unlink("temp/".$tempfile);
> }
> }
> ?>
> - SNAP -
> So I am copying the files to a temp dir, and then zip em up, delete 
them

> afterwards. I copy them to the dir so I wouldn't have the whole
> /kfz_images/number/full/ structure in the zip).
>
> Aaaanyhow, it works, it does work fast enough, and I am happy :o)
>
> Thanks a bunch, guys, and have a great day!
>
> This is Christian Haensel live from Extertal, Germany. Back to you.
>
> -:oD)=
>
>
> - Original Message - From: "Tijnema" <[EMAIL PROTECTED]>
> To: "Chris" <[EMAIL PROTECTED]>
> Cc: "Auto-Deppe, C. Haensel" <[EMAIL PROTECTED]>;
> 
> Sent: Friday, June 01, 2007 9:27 AM
> Subject: Re: [PHP] ZIP it :o)
>
>
>> On 6/1/07, Chris <[EMAIL PROTECTED]> wrote:
>>> Auto-Deppe, C. Haensel wrote:
>>> > Morning guys,
>>> >
>>> > I have been trying to find an easy to use way to zip an archive on
>>> a > linux
>>> > box running PHP5. Now I've tried the zip-lib.php and others, but 
they

>>> > always
>>> > throw an error msg But that is not the question.
>>> >
>>> > I am looking to use exec("zip archive.zip $directory");  $directory
>>> has
>>> > been
>>> > tried with both full path and relative path ... but that doesn't
>>> work. > I
>>> > don't get an error, it just doesn't create the zip-file...
>>> >
>>> > So, after a day of Google-ing and trying, I thought I might ask you
>>> for
>>> > help.
>>> >
>>> > Cheers for any answers and hints.
>>>
>>> http://pear.php.net/package/Archive_Zip and/or
>>> http://pear.php.net/package/File_Archive
>>>
>>> and please create a *new* message instead of replying to an 
existing one
>>> and changing the topic. It screws up message threading (in email 
clients

>>> and in the archives).
>>
>> Not in gmail :)
>>
>> I had same problem lately, wanted also to create zip files from PHP, i
>> tried various build in functions, but i ended up with the exec way.
>> It has been said before, but PHP probably doesn't have the right
>> permissions to write the .zip file, so i would recommend you to write
>> to /tmp first.
>>
>> Tijnema
>>
>>>
>>
>
Here's a link to the zip class that I use

http://www.phpclasses.org/browse/package/945.html

One thing though, your PHP install has to be compiled with "--with-zlib"

That was the only thing that I ran into with this.

Since you are creating files to download, with this class, you don't 
even need to write them to the
filesystem.  You just create the archive in memory (given that you 
have enough RAM && php is allowed
to consume as much memory as it would take the create the archive) and 
then dump it to the browser

Yes, but what happens when you try to create a 1GB archive with 512MB
RAM? (and no swap space too)
or if 100s of people call the same script that creates a 10-20MB file?
If you use the exec way, this will go fine :)

Tijnema

never said it would be the ops solution, but that it was my solution.

But isn't it nice to be able to know about different options that one might have to solve a given 
problem?


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Unknown

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



Re: [PHP] ZIP it :o)

2007-06-01 Thread Tijnema

On 6/1/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

Tijnema wrote:
> On 6/1/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
>> Auto-Deppe, C. Haensel wrote:
>> > Hi guys,
>> >
>> > thanks to Jim, I made it :o) Here's the source I'm using for testing
>> > now... it works. I just need to make it less vulnerable ;o)
>> >
>> > - SNIP -
>> > > > $nr  = $_GET['nr'];
>> > if(eregi("../", $nr)) {
>> > die("Hier wird nicht rumgehackt");
>> > }
>> > $directory = '_kfz_images/'.$nr.'/full/';
>> > $dir = opendir($directory);
>> > $i = 1;
>> > while($file = readdir($dir)) {
>> > $dest = "temp/Auto-Deppe-".$nr."_".$i.".jpg";
>> > if(eregi("jpg", $file)) {
>> >  copy($directory.$file, $dest);
>> >  $i++;
>> > }
>> > }
>> > $now = time();
>> > header("Content-Type: application/force-download");
>> > header('Content-Disposition: attachment;
>> > filename="Auto-Deppe-'.$now.'_Download.zip"');
>> > exec("zip ".$now."_archive.zip temp/* 2>&1", $output);
>> > readfile($now."_archive.zip");
>> > $tempdir = opendir("temp");
>> > while($tempfile = readdir($tempdir)) {
>> > if(eregi("jpg", $tempfile)) {
>> >  unlink("temp/".$tempfile);
>> > }
>> > }
>> > ?>
>> > - SNAP -
>> > So I am copying the files to a temp dir, and then zip em up, delete
>> them
>> > afterwards. I copy them to the dir so I wouldn't have the whole
>> > /kfz_images/number/full/ structure in the zip).
>> >
>> > Aaaanyhow, it works, it does work fast enough, and I am happy :o)
>> >
>> > Thanks a bunch, guys, and have a great day!
>> >
>> > This is Christian Haensel live from Extertal, Germany. Back to you.
>> >
>> > -:oD)=
>> >
>> >
>> > - Original Message - From: "Tijnema" <[EMAIL PROTECTED]>
>> > To: "Chris" <[EMAIL PROTECTED]>
>> > Cc: "Auto-Deppe, C. Haensel" <[EMAIL PROTECTED]>;
>> > 
>> > Sent: Friday, June 01, 2007 9:27 AM
>> > Subject: Re: [PHP] ZIP it :o)
>> >
>> >
>> >> On 6/1/07, Chris <[EMAIL PROTECTED]> wrote:
>> >>> Auto-Deppe, C. Haensel wrote:
>> >>> > Morning guys,
>> >>> >
>> >>> > I have been trying to find an easy to use way to zip an archive on
>> >>> a > linux
>> >>> > box running PHP5. Now I've tried the zip-lib.php and others, but
>> they
>> >>> > always
>> >>> > throw an error msg But that is not the question.
>> >>> >
>> >>> > I am looking to use exec("zip archive.zip $directory");  $directory
>> >>> has
>> >>> > been
>> >>> > tried with both full path and relative path ... but that doesn't
>> >>> work. > I
>> >>> > don't get an error, it just doesn't create the zip-file...
>> >>> >
>> >>> > So, after a day of Google-ing and trying, I thought I might ask you
>> >>> for
>> >>> > help.
>> >>> >
>> >>> > Cheers for any answers and hints.
>> >>>
>> >>> http://pear.php.net/package/Archive_Zip and/or
>> >>> http://pear.php.net/package/File_Archive
>> >>>
>> >>> and please create a *new* message instead of replying to an
>> existing one
>> >>> and changing the topic. It screws up message threading (in email
>> clients
>> >>> and in the archives).
>> >>
>> >> Not in gmail :)
>> >>
>> >> I had same problem lately, wanted also to create zip files from PHP, i
>> >> tried various build in functions, but i ended up with the exec way.
>> >> It has been said before, but PHP probably doesn't have the right
>> >> permissions to write the .zip file, so i would recommend you to write
>> >> to /tmp first.
>> >>
>> >> Tijnema
>> >>
>> >>>
>> >>
>> >
>> Here's a link to the zip class that I use
>>
>> http://www.phpclasses.org/browse/package/945.html
>>
>> One thing though, your PHP install has to be compiled with "--with-zlib"
>>
>> That was the only thing that I ran into with this.
>>
>> Since you are creating files to download, with this class, you don't
>> even need to write them to the
>> filesystem.  You just create the archive in memory (given that you
>> have enough RAM && php is allowed
>> to consume as much memory as it would take the create the archive) and
>> then dump it to the browser
> Yes, but what happens when you try to create a 1GB archive with 512MB
> RAM? (and no swap space too)
> or if 100s of people call the same script that creates a 10-20MB file?
> If you use the exec way, this will go fine :)
>
> Tijnema
never said it would be the ops solution, but that it was my solution.


Nope, you didn't but you noted the difference in speed for both, but
you didn't note any problems that could occur.


But isn't it nice to be able to know about different options that one might 
have to solve a given
problem?

--
Jim Lucas


Sure it is, but don't forget to note the negative things of the option.!

Tijnema

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



Re: [PHP] ZIP it :o)

2007-06-01 Thread Jim Lucas

Tijnema wrote:

On 6/1/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

Tijnema wrote:
> On 6/1/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
>> Auto-Deppe, C. Haensel wrote:
>> > Hi guys,
>> >
>> > thanks to Jim, I made it :o) Here's the source I'm using for testing
>> > now... it works. I just need to make it less vulnerable ;o)
>> >
>> > - SNIP -
>> > > > $nr  = $_GET['nr'];
>> > if(eregi("../", $nr)) {
>> > die("Hier wird nicht rumgehackt");
>> > }
>> > $directory = '_kfz_images/'.$nr.'/full/';
>> > $dir = opendir($directory);
>> > $i = 1;
>> > while($file = readdir($dir)) {
>> > $dest = "temp/Auto-Deppe-".$nr."_".$i.".jpg";
>> > if(eregi("jpg", $file)) {
>> >  copy($directory.$file, $dest);
>> >  $i++;
>> > }
>> > }
>> > $now = time();
>> > header("Content-Type: application/force-download");
>> > header('Content-Disposition: attachment;
>> > filename="Auto-Deppe-'.$now.'_Download.zip"');
>> > exec("zip ".$now."_archive.zip temp/* 2>&1", $output);
>> > readfile($now."_archive.zip");
>> > $tempdir = opendir("temp");
>> > while($tempfile = readdir($tempdir)) {
>> > if(eregi("jpg", $tempfile)) {
>> >  unlink("temp/".$tempfile);
>> > }
>> > }
>> > ?>
>> > - SNAP -
>> > So I am copying the files to a temp dir, and then zip em up, delete
>> them
>> > afterwards. I copy them to the dir so I wouldn't have the whole
>> > /kfz_images/number/full/ structure in the zip).
>> >
>> > Aaaanyhow, it works, it does work fast enough, and I am happy :o)
>> >
>> > Thanks a bunch, guys, and have a great day!
>> >
>> > This is Christian Haensel live from Extertal, Germany. Back to you.
>> >
>> > -:oD)=
>> >
>> >
>> > - Original Message - From: "Tijnema" <[EMAIL PROTECTED]>
>> > To: "Chris" <[EMAIL PROTECTED]>
>> > Cc: "Auto-Deppe, C. Haensel" <[EMAIL PROTECTED]>;
>> > 
>> > Sent: Friday, June 01, 2007 9:27 AM
>> > Subject: Re: [PHP] ZIP it :o)
>> >
>> >
>> >> On 6/1/07, Chris <[EMAIL PROTECTED]> wrote:
>> >>> Auto-Deppe, C. Haensel wrote:
>> >>> > Morning guys,
>> >>> >
>> >>> > I have been trying to find an easy to use way to zip an 
archive on

>> >>> a > linux
>> >>> > box running PHP5. Now I've tried the zip-lib.php and others, but
>> they
>> >>> > always
>> >>> > throw an error msg But that is not the question.
>> >>> >
>> >>> > I am looking to use exec("zip archive.zip $directory");  
$directory

>> >>> has
>> >>> > been
>> >>> > tried with both full path and relative path ... but that doesn't
>> >>> work. > I
>> >>> > don't get an error, it just doesn't create the zip-file...
>> >>> >
>> >>> > So, after a day of Google-ing and trying, I thought I might 
ask you

>> >>> for
>> >>> > help.
>> >>> >
>> >>> > Cheers for any answers and hints.
>> >>>
>> >>> http://pear.php.net/package/Archive_Zip and/or
>> >>> http://pear.php.net/package/File_Archive
>> >>>
>> >>> and please create a *new* message instead of replying to an
>> existing one
>> >>> and changing the topic. It screws up message threading (in email
>> clients
>> >>> and in the archives).
>> >>
>> >> Not in gmail :)
>> >>
>> >> I had same problem lately, wanted also to create zip files from 
PHP, i

>> >> tried various build in functions, but i ended up with the exec way.
>> >> It has been said before, but PHP probably doesn't have the right
>> >> permissions to write the .zip file, so i would recommend you to 
write

>> >> to /tmp first.
>> >>
>> >> Tijnema
>> >>
>> >>>
>> >>
>> >
>> Here's a link to the zip class that I use
>>
>> http://www.php

Re: [PHP] ZIP it :o)

2007-06-01 Thread Richard Lynch


On Fri, June 1, 2007 12:30 am, Auto-Deppe, C. Haensel wrote:
> Morning guys,
>
> I have been trying to find an easy to use way to zip an archive on a
> linux
> box running PHP5. Now I've tried the zip-lib.php and others, but they
> always
> throw an error msg But that is not the question.
>
> I am looking to use exec("zip archive.zip $directory");  $directory
> has been
> tried with both full path and relative path ... but that doesn't work.
> I
> don't get an error, it just doesn't create the zip-file...
>
> So, after a day of Google-ing and trying, I thought I might ask you
> for
> help.
>
> Cheers for any answers and hints.

HINT:
I'd love to alter the PHP source so that the 2 optional args to exec()
are NOT optional anymore...

It would forestall a lot of 'exec' questions on this list... :-)

Use full paths everywhere, or you'll end up cursing again some other
day.  That includes the full path to the binary program 'zip' and the
file 'archive.zip' and the '$directory'

You also MUST understand that PHP runs as a specific user, which on
Apache is defined in httpd.conf, and is rarely the same user as your
SSH login user.  So what you can do in the command line has little
bearing on what that user can do in 'exec'

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] ZIP it :o)

2007-06-01 Thread Richard Lynch
On a busy server, with many many users, it is remotely possible that
your time() call will not be unique, and 2 users will end up
corrupting each others' zip files...

PHP has built-in functions for making temp files with unique names.

Use them.

On Fri, June 1, 2007 2:32 am, Auto-Deppe, C. Haensel wrote:
> Hi guys,
>
> thanks to Jim, I made it :o) Here's the source I'm using for testing
> now...
> it works. I just need to make it less vulnerable ;o)
>
> - SNIP -
>  $nr  = $_GET['nr'];
> if(eregi("../", $nr)) {
>  die("Hier wird nicht rumgehackt");
> }
> $directory = '_kfz_images/'.$nr.'/full/';
> $dir = opendir($directory);
> $i = 1;
> while($file = readdir($dir)) {
>  $dest = "temp/Auto-Deppe-".$nr."_".$i.".jpg";
>  if(eregi("jpg", $file)) {
>   copy($directory.$file, $dest);
>   $i++;
>  }
> }
> $now = time();
> header("Content-Type: application/force-download");
> header('Content-Disposition: attachment;
> filename="Auto-Deppe-'.$now.'_Download.zip"');
> exec("zip ".$now."_archive.zip temp/* 2>&1", $output);
> readfile($now."_archive.zip");
> $tempdir = opendir("temp");
> while($tempfile = readdir($tempdir)) {
>  if(eregi("jpg", $tempfile)) {
>   unlink("temp/".$tempfile);
>  }
> }
> ?>
> - SNAP -
> So I am copying the files to a temp dir, and then zip em up, delete
> them
> afterwards. I copy them to the dir so I wouldn't have the whole
> /kfz_images/number/full/ structure in the zip).
>
> Aaaanyhow, it works, it does work fast enough, and I am happy :o)
>
> Thanks a bunch, guys, and have a great day!
>
> This is Christian Haensel live from Extertal, Germany. Back to you.
>
> -:oD)=
>
>
> - Original Message -
> From: "Tijnema" <[EMAIL PROTECTED]>
> To: "Chris" <[EMAIL PROTECTED]>
> Cc: "Auto-Deppe, C. Haensel" <[EMAIL PROTECTED]>;
> 
> Sent: Friday, June 01, 2007 9:27 AM
> Subject: Re: [PHP] ZIP it :o)
>
>
>> On 6/1/07, Chris <[EMAIL PROTECTED]> wrote:
>>> Auto-Deppe, C. Haensel wrote:
>>> > Morning guys,
>>> >
>>> > I have been trying to find an easy to use way to zip an archive
>>> on a
>>> > linux
>>> > box running PHP5. Now I've tried the zip-lib.php and others, but
>>> they
>>> > always
>>> > throw an error msg But that is not the question.
>>> >
>>> > I am looking to use exec("zip archive.zip $directory");
>>> $directory has
>>> > been
>>> > tried with both full path and relative path ... but that doesn't
>>> work.
>>> > I
>>> > don't get an error, it just doesn't create the zip-file...
>>> >
>>> > So, after a day of Google-ing and trying, I thought I might ask
>>> you for
>>> > help.
>>> >
>>> > Cheers for any answers and hints.
>>>
>>> http://pear.php.net/package/Archive_Zip and/or
>>> http://pear.php.net/package/File_Archive
>>>
>>> and please create a *new* message instead of replying to an
>>> existing one
>>> and changing the topic. It screws up message threading (in email
>>> clients
>>> and in the archives).
>>
>> Not in gmail :)
>>
>> I had same problem lately, wanted also to create zip files from PHP,
>> i
>> tried various build in functions, but i ended up with the exec way.
>> It has been said before, but PHP probably doesn't have the right
>> permissions to write the .zip file, so i would recommend you to
>> write
>> to /tmp first.
>>
>> Tijnema
>>
>>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] PHP Zip Question

2006-10-26 Thread Richard Lynch
Post a link to your on-line application.

Also, use LiveHTTPHeaders and such to make sure you are getting what
you think you are getting.

And use vi or TextPad or whatever on your desktop to open up the .zip
file and see what's in there.

If it starts with:
ERROR: PHP error blah blah blah
then you've got a pretty good idea why it's not a valid zip file :-)

On Tue, October 24, 2006 6:39 am, Matt Street wrote:
> Dear all,
>
> I am trying to create a zipping mechanism that allows the user to
> select a
> number of files from a list; these files are then zipped and
> downloaded to
> the user's machine. I presently have:
>
> $zip = new ZipArchive();
> $filename = $zipfinalpath."tutor/zipfiles/".$tutorzipfile;
>
> if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
>   exit("cannot open <$filename> \n");
> }
> else {
>   $loopCount = 0;
>   foreach ($filelisttozip as $i => $fileValue) {
>   //the
>   $zip->addFile($fileValue,$filenamelisttozip[$loopCount]);
>   $loopCount ++;
>   }
> }
>
> $zip->close();
>
> In my test sample of files I have the following file types:
>
> .doc
> .zip
> .jpg
> .doc
>
> And the zip mechanism works when I ask for all or omit any of the
> files from
> the list, except when I omit the zip file! E.g.
>
> 1. Asking for all works
> 2. Asking for .zip,.jpg,.doc works
> 3. Asking for .doc,.zip works
> 4. Asking for .doc,.jpg,.doc doesn't work - 7-zip tells me that the
> file is
> not support archive and windows tells me the Compressed(folder) is
> invalid
> or corrupted!
>
> I have used different zip files to make sure that it's not the file,
> but all
> to no avail. . .but if I add:
>
> $zip = zip_open($filename);
> while ($zip_entry = zip_read($zip)) {
>   $file = basename(zip_entry_name($zip_entry));
>
>   echo 'a'.$file.'';
> }
> zip_close($zip);
>
> to the bottom of my page it correctly displays, on screen, the 3 files
> I
> expect to be in the zip file.
>
> Any help would be very gratefully received as this is driving me
> mad!!!
>
> Matt
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



RE: [PHP] PHP Zip Question

2006-11-06 Thread Matt Street
Thanks for the response, I decided that it was easier to unpack the zip 
during the upload process and then delete the zip. I can then indicate 
which files I want to zip up and this works (opening the zip on the 
server), but, and it's a big but, when the zip is downloaded to the 
users machine it is being corrupted! 

To force the download I use: 

header('Content-type: application/zip'); 
header('Content-Disposition:  attachment; filename='.$tutorzipfile); 
readfile($filename); 

Which correctly gives me: 

Content-Type: application/zip 
Content-disposition: attachment; filename=tutorzipfile.zip 

when viewing the LiveHTTPHeaders extension in firefox. 

However, when I view the zip file that is downloaded to my machine, in 
Textpad, php has appended the directory information of the files I'm 
zipping up onto the front of the zip file, so it no longer starts PK!!! 

Anyone any ideas??? 

Thanks in advance 

Matt

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



RE: [PHP] PHP Zip Question

2006-11-06 Thread Richard Lynch
On Mon, November 6, 2006 6:28 am, Matt Street wrote:
> Thanks for the response, I decided that it was easier to unpack the
> zip
> during the upload process and then delete the zip. I can then indicate
> which files I want to zip up and this works (opening the zip on the
> server), but, and it's a big but, when the zip is downloaded to the
> users machine it is being corrupted!
>
> To force the download I use:
>
> header('Content-type: application/zip');
> header('Content-Disposition:  attachment; filename='.$tutorzipfile);
> readfile($filename);
>
> Which correctly gives me:
>
> Content-Type: application/zip
> Content-disposition: attachment; filename=tutorzipfile.zip
>
> when viewing the LiveHTTPHeaders extension in firefox.

Rant #37
http://richardlynch.blogspot.com/

> However, when I view the zip file that is downloaded to my machine, in
> Textpad, php has appended the directory information of the files I'm
> zipping up onto the front of the zip file, so it no longer starts
> PK!!!

PHP didn't do it.

Your zip routines may have done it.

Your code may have done it.

But PHP is not, no its own, just outputting the directory info for no
real reason.

Put an exit right before you readfile() and the headers.

You may need to move the headers down below all the code that
calculates what's getting zipped up and all that...

Dollars to donuts says you've left behind a debugging:
echo pwd();
or something similar.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



RE: [PHP] PHP Zip Question

2006-11-07 Thread Matt Street
Richard,

Thank you for your post and the link to your rant. Indeed I am a PHP newbie
and have fallen into the advice I have been given through google. . .

I have added an exit and probably owe you a donut as I had to remove a
couple of echo's from my code! However, the good news after all of this is
that my code is now working and I can finish off my tests.

Thanks again

Matt

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: 06 November 2006 21:02
To: Matt Street
Cc: 'php-general@lists.php.net'
Subject: RE: [PHP] PHP Zip Question

On Mon, November 6, 2006 6:28 am, Matt Street wrote:
> Thanks for the response, I decided that it was easier to unpack the
> zip
> during the upload process and then delete the zip. I can then indicate
> which files I want to zip up and this works (opening the zip on the
> server), but, and it's a big but, when the zip is downloaded to the
> users machine it is being corrupted!
>
> To force the download I use:
>
> header('Content-type: application/zip');
> header('Content-Disposition:  attachment; filename='.$tutorzipfile);
> readfile($filename);
>
> Which correctly gives me:
>
> Content-Type: application/zip
> Content-disposition: attachment; filename=tutorzipfile.zip
>
> when viewing the LiveHTTPHeaders extension in firefox.

Rant #37
http://richardlynch.blogspot.com/

> However, when I view the zip file that is downloaded to my machine, in
> Textpad, php has appended the directory information of the files I'm
> zipping up onto the front of the zip file, so it no longer starts
> PK!!!

PHP didn't do it.

Your zip routines may have done it.

Your code may have done it.

But PHP is not, no its own, just outputting the directory info for no
real reason.

Put an exit right before you readfile() and the headers.

You may need to move the headers down below all the code that
calculates what's getting zipped up and all that...

Dollars to donuts says you've left behind a debugging:
echo pwd();
or something similar.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



[PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Hello,

I'd like to uncompress to the Hard disk a zip file send by the browser.

At this time I do this:

function uncompresszip($zipfile) {
  copy($zipfile, dirname($_SERVER['PATH_TRANSLATED'])."/zip/zipfile.zip") ;
}
But I do not understand how to uncompress the zip file, I tried for exemple:
$retour = 
readgzfile(dirname($_SERVER['PATH_TRANSLATED'])."/zip/zipfile.zip");

But as mentionned in the php doc it outputs the content of the zip file 
in the browser :-(

How to uncompress a zip file in a directory ? I just want all the files 
which are in the zip file...

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


re: [PHP] Zip to postcode

2003-04-02 Thread skate
sorry, don't have anything to add for code, but just a note to remember that UK post 
codes can also be in the form...

QQ11 1QQ
Q1 1QQ
Q11 1QQ
QQ1 1QQ

so it's a real pain to write an expression for this...

-skate-




Can someone please tell me how i change the following code:
if (!ereg("^[0-9]{5,5}(\-[0-9]{4,4})?$",$postcode))

to a UK postcode QQ1 1QQ
When i fill out the form it tells me that the postcode is not valid and i
think it is because it is in zip code format.

Thank you

Andy



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



re: [PHP] Zip to postcode

2003-04-02 Thread Peter Hicks

Don't forget some London postcodes are Q1Q QQQ!


Peter.


On Wed, 2 Apr 2003, skate wrote:

> sorry, don't have anything to add for code, but just a note to remember that UK post 
> codes can also be in the form...
>
> QQ11 1QQ
> Q1 1QQ
> Q11 1QQ
> QQ1 1QQ
>
> so it's a real pain to write an expression for this...
>
> -skate-
>
>
>
>
> Can someone please tell me how i change the following code:
> if (!ereg("^[0-9]{5,5}(\-[0-9]{4,4})?$",$postcode))
>
> to a UK postcode QQ1 1QQ
> When i fill out the form it tells me that the postcode is not valid and i
> think it is because it is in zip code format.
>
> Thank you
>
> Andy
>
>
>
>


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



Re: [PHP] Zip to postcode

2003-04-02 Thread William Bailey
Hi Andy,

The following function seems to work for me:

function split_postcode ($postcode) {
if(eregi('(^[A-Z]{1,2})([0-9|A-Z]{1,2}).*([0-9][A-Z]{2}$)', str_replace(' 
', '', $postcode), $parts)){
$outcode=strtoupper(sprintf('%s%s%s', $parts[1], @str_repeat(' ', 
4-strlen($parts[1])-strlen($parts[2])), $parts[2]));
$incode=strtoupper($parts[3]);
return array($outcode, $incode);
}else{
return False;
}
}

On Wednesday 02 April 2003 12:54, Andy wrote:
> Can someone please tell me how i change the following code:
> if (!ereg("^[0-9]{5,5}(\-[0-9]{4,4})?$",$postcode))
>
> to a UK postcode QQ1 1QQ
> When i fill out the form it tells me that the postcode is not valid and i
> think it is because it is in zip code format.
>
> Thank you
>
> Andy

-- 
Regards,
William Bailey.
Pro-Net Internet Services Ltd.
http://www.pro-net.co.uk
http://wb.pro-net.co.uk


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



[PHP] php zip/store locator code.....

2002-05-03 Thread Andras Kende

Hello All,

I looking for a zip / store locator based with php/mysql
I find this 2 similar but no luck yet.

http://px.sklar.com/author.html?author_id=296
http://www.sanisoft.com/ziploc/

Any where should I look around...


Thank,

Andras Kende



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




Re: [PHP] ZIP combinaton in PHP?

2002-06-30 Thread Jason Wong

On Sunday 30 June 2002 15:32, Tony Harrison wrote:
> I realise its a longshot but is it possible to use PHP (or any other
> web-based languages) to combine multiple ZIP files into a single ZIP file?
> and any scripts i can download to do it.
>
> Any help with this is most appreciated. ;-)

If you have a command-line zip program on your system then just use exec() (or 
friends) to run it.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
... I see TOILET SEATS ...
*/


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




[PHP] Zip mulitple files for download

2001-07-31 Thread Karl J. Stubsjoen

GlacierHello,
I need to zip multiple files into 1 zip file for download.  Which function
do I use to accomplish this?
Thanks!


Karl J. Stubsjoen
www.iexcelinlife.com
[EMAIL PROTECTED]
Phone:  602.447




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] ZIp files? Help needed...

2001-11-29 Thread Robert V. Zwink

This might interest you:
http://marc.theaimsgroup.com/?l=php-general&m=100453803524687&w=2

You can install Winzip on the machine, then shell out to unzip the file.

Robert V. Zwink
http://www.zwink.net/daid.php

-Original Message-
From: Emiliano Marmonti [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 29, 2001 1:07 PM
To: Lista PHP
Subject: [PHP] ZIp files? Help needed...


Hi people,

I´m looking for alternatives in using zip files. Our users should upload
into our server zipped files and we need to unzip this files and process it.
I have read there is a library that could be used like an extension, but
I´ve tried to use it from NT and don´t seems like the extension was added
and when I try to use the commands PHP says that don´t recognoice the
commands. In the other hand somebody has told me that PHP must be recompiled
for using this library. Our platform is Windows NT but in the future could
be Solaris.

Anybody could send me your experience?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] zip codes and lat/longs

2007-12-05 Thread tedd

Hi gang:

I'm entertaining how to determine what zip codes fall within a 50 
mile radius of another zip code.


Anyone done this before?

Also, does anyone have any sources for zip codes and lat/long databases?

TIA for any help/suggestions.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] [RE-PHRASE] PHP ZIP Class

2005-06-16 Thread Jay Blanchard
I am in need of a PHP class or script or something that will allow me to
designate a group of files to be zipped up, including PDF files,
automagically. It must be compatible with WinZip as that is what the
user will have access to. I have tried several things, a couple of
classes, and some other tricks to no avail. There seems to be an issue
with PDF's that I cannot figure out. The files are usually 1 byte too
short when you try to open them after unzipping them, and are therefore
corrupt.

If anyone is aware of something would you please let me know? I am even
willing at this point to add a couple of layers of abstraction to make
this work as long as the process is relatively invisible to the end
user. My desire is that it works like this;

User clicks link
[start automagic stuff]
*whirring* //determine which files should go into archive
*clicking* //put files in archive
[/end automagic stuff]
User presented with dialog box to save archive

Any and all clues are appreciated.

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



Re: [PHP] Zip Way of life.

2003-03-19 Thread Marek Kilimajer
readgzfile is for *.gz files.
Either use zip file functions (rarely supported) or PclZip 
(http://www.phpconcept.net/pclzip/index.en.php)

Vincent M. wrote:

Hello,

I'd like to uncompress to the Hard disk a zip file send by the browser.

At this time I do this:

function uncompresszip($zipfile) {
  copy($zipfile, 
dirname($_SERVER['PATH_TRANSLATED'])."/zip/zipfile.zip") ;
}

But I do not understand how to uncompress the zip file, I tried for 
exemple:
$retour = 
readgzfile(dirname($_SERVER['PATH_TRANSLATED'])."/zip/zipfile.zip");

But as mentionned in the php doc it outputs the content of the zip 
file in the browser :-(

How to uncompress a zip file in a directory ? I just want all the 
files which are in the zip file...

Thanks,
Vincent.



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


Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Marek Kilimajer wrote:
readgzfile is for *.gz files.
Either use zip file functions (rarely supported) or PclZip 
(http://www.phpconcept.net/pclzip/index.en.php)

No, it works with .zip files too, I just don't know how to manage it :-(



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


RE: [PHP] Zip Way of life.

2003-03-19 Thread Daevid Vincent
You could use the exec() or shell_exec() and just do it via command line
method...

> -Original Message-
> From: Vincent M. [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, March 19, 2003 12:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Zip Way of life.
> 
> 
> Hello,
> 
> I'd like to uncompress to the Hard disk a zip file send by 
> the browser.
> 
> At this time I do this:
> 
> function uncompresszip($zipfile) {
>copy($zipfile, 
> dirname($_SERVER['PATH_TRANSLATED'])."/zip/zipfile.zip") ;
> }
> 
> But I do not understand how to uncompress the zip file, I 
> tried for exemple:
> $retour = 
> readgzfile(dirname($_SERVER['PATH_TRANSLATED'])."/zip/zipfile.zip");
> 
> But as mentionned in the php doc it outputs the content of 
> the zip file 
> in the browser :-(
> 
> How to uncompress a zip file in a directory ? I just want all 
> the files 
> which are in the zip file...
> 
> Thanks,
> Vincent.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



Re: [PHP] Zip Way of life.

2003-03-19 Thread David T-G
Vincent, et al --

...and then Vincent M. said...
% 
% Marek Kilimajer wrote:
% >readgzfile is for *.gz files.
...
% No, it works with .zip files too, I just don't know how to manage it :-(

You mentioned wanting the "files" (note the plural) in the zip file.
AFAIK gunzip can unzip an archive containing a single file, but if you
have more than one in there then you need to use an actual unzip tool
(like, say, unzip :-)

While a class or a built-in command might be nice, if you just want to
get them out then a simple system call might be the easiest way to go.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
David T-G wrote:
Vincent, et al --

...and then Vincent M. said...
% 
% Marek Kilimajer wrote:
% >readgzfile is for *.gz files.
...
% No, it works with .zip files too, I just don't know how to manage it :-(

You mentioned wanting the "files" (note the plural) in the zip file.
AFAIK gunzip can unzip an archive containing a single file, but if you
have more than one in there then you need to use an actual unzip tool
(like, say, unzip :-)
While a class or a built-in command might be nice, if you just want to
get them out then a simple system call might be the easiest way to go.
HTH & HAND

:-D
Yes but gunzip does not work when there are more than one file in the 
zip file and unzip is not installed by on Unix servers. :-(

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


Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Daevid Vincent wrote:
You could use the exec() or shell_exec() and just do it via command line
method...
Yes but gunzip does not work when there are more than one file in the 
zip file and unzip is not installed by default on Unix servers. :-(





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


Re: [PHP] Zip Way of life.

2003-03-19 Thread David T-G
Vincent --

...and then Vincent M. said...
% 
% David T-G wrote:
% >
% >...and then Vincent M. said...
% >% 
...
% >% No, it works with .zip files too, I just don't know how to manage it :-(
% >
...
% >AFAIK gunzip can unzip an archive containing a single file, but if you
% >have more than one in there then you need to use an actual unzip tool
...
% 
% Yes but gunzip does not work when there are more than one file in the 

Right.  That's exactly what I said.  Is there still any confusion?


% zip file and unzip is not installed by on Unix servers. :-(

So go and get your own copy and put it on!


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] Zip Way of life.

2003-03-20 Thread Daevid Vincent
> zip file and unzip is not installed by on Unix servers. :-(

So either install it on the servers that need it, or distribute the un/zip
exe with your package in your projects local directory -- this also saves
you having to deal with different versions on different servers that may not
always do what you expect. At least this way it's a controlled environment. 


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



Re: [PHP] Zip Way of life.

2003-03-26 Thread Marek Kilimajer
So use PclZip class, it is pure php without the need to have nay special 
extension installed

Vincent M. wrote:

Daevid Vincent wrote:

You could use the exec() or shell_exec() and just do it via command line
method...
Yes but gunzip does not work when there are more than one file in the 
zip file and unzip is not installed by default on Unix servers. :-(







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


RE: [PHP] Zip to postcode[Scanned]

2003-04-02 Thread Michael Egan
Andy,

There are some ready made scripts for dealing with UK post codes on the relevant page 
on the PHP site:

http://www.php.net/manual/en/function.ereg.php


HTH,

Michael Egan

-Original Message-
From: Andy [mailto:[EMAIL PROTECTED]
Sent: 02 April 2003 12:54
To: [EMAIL PROTECTED]
Subject: [PHP] Zip to postcode[Scanned]


Can someone please tell me how i change the following code:
if (!ereg("^[0-9]{5,5}(\-[0-9]{4,4})?$",$postcode))

to a UK postcode QQ1 1QQ
When i fill out the form it tells me that the postcode is not valid and i
think it is because it is in zip code format.

Thank you

Andy



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



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



RE: [PHP] Zip to postcode[Scanned]

2003-04-02 Thread Ford, Mike [LSS]
> -Original Message-
> From: Michael Egan [mailto:[EMAIL PROTECTED]
> Sent: 02 April 2003 13:05
> 
> There are some ready made scripts for dealing with UK post 
> codes on the relevant page on the PHP site:
> 
> http://www.php.net/manual/en/function.ereg.php

And not one of them is 100% correct!!  This would be my stab:

preg_match('/^([A-Z]{1,2}([0-9]{1,2})|[0-9][A-Z])|GIR)'
   . ' ?[0-9][A-Z]{2}$/i', $postcode)

(I've divided the pattern in two here simply to avoid strange line wrapping!)

One of the user notes referred to says that postcodes are sometimes written with a 
space after the initial letters; although technically this is incorrect, adjusting to 
allow it would give:

preg_match('/^([A-Z]{1,2} ?([0-9]{1,2})|[0-9][A-Z])|GIR)'
   . ' ?[0-9][A-Z]{2}$/i', $postcode)

Another states that the set of letters in the last two positions is restricted -- I 
can't vouch for the accuracy of this, but if it's the case the match would become:

preg_match('/^([A-Z]{1,2} ?([0-9]{1,2})|[0-9][A-Z])|GIR)'
   . ' ?[0-9]}[ABD-HJLNP-UW-Z]{2}$/i', $postcode)

Finally, if you really, really want to accept only completely valid postcodes (not 
just validly formatted ones), you should get the full list of postcode area 
identifiers (the initial letter or two) and validate against those -- plus any local 
peculiarities that occur (for example, in my local postcode area, the final digit is 2 
in *all* cases).  (Well, I guess here we're getting into the realms of paying for the 
Royal Mail's postcode database!!)

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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



[PHP] zip code validation/regular expression

2003-06-02 Thread Jason Paschal
Simply trying to use regular expressions to validate a 5 or 5+4 zip code, 
excluding 0 and 0-.  Looked on http://www.regexlib.com, and 
that's where I found the pattern below, but it doesn't work.  The best I can 
do on my own is two separate regular expressions, one to match a valid zip, 
and another to match the 0 invalid code.  I would really like to 
condense it into one, just because I think it should be possible.
This code below is suppose to do all this for me, but it's not matching as 
I'd hoped.  I get results like this:

21832-1234 MATCHES.
0- MATCHES.
0 MATCHES.
1234 doesn't match.
ABCDEF doesn't match.
ABC doesn't match.
I'd appreciate any help.  Thanks,
jason


$regex1 = "/^(\?(^0(|-))|(\d{5}(|-\d{4})))$/";

$zips = 
array("21243","21832-1234","0-","0","1234","ABCDEF","ABC");

foreach ($zips as $zip) {
if (preg_match($regex1,$zip)) {
echo "$zip MATCHES.";
} else {
echo "$zip doesn't match.";
}
}
?>

_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus

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


[PHP] Zip Code Locator / Radius Search

2003-11-20 Thread Becoming Digital
I need a "search by zip code," aka radius search feature for a current project.  I 
know I've seen info on how this works but I can't seem to find it.  I guess my own 
search abilities are malfunctioning.  Would someone be so kind as to point me to a 
link?  Thanks a lot.

Edward Dudlik
"Those who say it cannot be done
should not interrupt the person doing it."

wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU

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



RE: [PHP] php zip/store locator code.....

2002-05-03 Thread John Holmes

Try this:

http://www.phpclasses.org/browse.html/package/522.html

---John Holmes...

> -Original Message-
> From: Andras Kende [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 03, 2002 1:23 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] php zip/store locator code.
> 
> Hello All,
> 
> I looking for a zip / store locator based with php/mysql
> I find this 2 similar but no luck yet.
> 
> http://px.sklar.com/author.html?author_id=296
> http://www.sanisoft.com/ziploc/
> 
> Any where should I look around...
> 
> 
> Thank,
> 
> Andras Kende
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] Zip mulitple files for download

2001-07-31 Thread Jon Haworth

> GlacierHello,
> I need to zip multiple files into 1 zip file for download.
> Which function do I use to accomplish this?
> Thanks!

http://www.php.net/exec

HTH
Jon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] zip codes and lat/longs

2007-12-05 Thread Bastien Koert

hate to say it,but there is lots on google like
 
http://www.code322.com/zipcode_locator.php
 
bastien> Date: Wed, 5 Dec 2007 20:58:52 -0500> To: php-general@lists.php.net> 
From: [EMAIL PROTECTED]> Subject: [PHP] zip codes and lat/longs> > Hi gang:> > 
I'm entertaining how to determine what zip codes fall within a 50 > mile radius 
of another zip code.> > Anyone done this before?> > Also, does anyone have any 
sources for zip codes and lat/long databases?> > TIA for any help/suggestions.> 
> Cheers,> > tedd> -- > ---> http://sperling.com http://ancientstones.com 
http://earthstones.com> > -- > PHP General Mailing List (http://www.php.net/)> 
To unsubscribe, visit: http://www.php.net/unsub.php> 
_
Discover new ways to stay in touch with Windows Live! Visit the City @ Live 
today!
http://getyourliveid.ca/?icid=LIVEIDENCA006

Re: [PHP] zip codes and lat/longs

2007-12-05 Thread mike
Here's code I had, but it recently stopped working

It takes the zip code for the user and the user you're viewing, looks
them up from the data table (z_data_zips) and does the calculation.
The formula is in a handful of places - I converted mine from a MySQL
example (I think, or vice versa)

You can get the zip code lat/long info from the Census Bureau

I believe this is where you get the file:
http://www.census.gov/geo/www/gazetteer/places2k.html

You want the "ZCTAs (ZIP Code Tabulation Areas): (33,233 records)"
file - the schema is at the bottom of the page.

Perhaps someone else might also find the error in my code below that's
changed and save me the time to figure out why it no longer works :)
(for all I know it could be a problem with MySQL result set too)

if($visitor['uid'] > 0) {
$uchk = db_query("SELECT up.country,uz.zip FROM user_profile
up LEFT JOIN user_zip uz ON uz.uid=up.uid WHERE up.uid=$visitor
[uid]");
if(db_numrows($uchk) == 1) {
list($vc,$vz) = db_rows($uchk);
$vz = intval($vz);
$user_zip = intval($user_zip);

$zchk1 = db_query("SELECT latitude,longitude
FROM z_data_zips WHERE zip=$user_zip");
list($ulat,$ulong) = db_rows($zchk1);
db_free($zchk1);
$zchk2 = db_query("SELECT latitude,longitude
FROM z_data_zips WHERE zip=$vz");
list($vlat,$vlong) = db_rows($zchk2);
db_free($zchk2);
$distance =
number_format(ceil(69*rad2deg(acos(sin(deg2rad($ulat)) *
sin(deg2rad($vlat)) + cos(deg2rad($ulat
)) * cos(deg2rad($vlat)) * cos(deg2rad($ulong - $vlong));
echo "Distance from
you: $distance miles.\n";

}
db_free($uchk);
}


On 12/5/07, tedd <[EMAIL PROTECTED]> wrote:
> Hi gang:
>
> I'm entertaining how to determine what zip codes fall within a 50
> mile radius of another zip code.
>
> Anyone done this before?
>
> Also, does anyone have any sources for zip codes and lat/long databases?
>
> TIA for any help/suggestions.
>
> Cheers,
>
> tedd
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread Daniel Brown
On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
> Hi gang:
>
> I'm entertaining how to determine what zip codes fall within a 50
> mile radius of another zip code.
>
> Anyone done this before?
>
> Also, does anyone have any sources for zip codes and lat/long databases?

Tedd,

I have all of this in a MySQL database already, with census
information, water table info, and more.  If you want to take a look,
let me know and I'll give you a peek via phpMyAdmin to see if it'll
match your needs.

For you, it's free.  All else must PAY  ;-P

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread Jason Pruim


On Dec 6, 2007, at 10:29 AM, Daniel Brown wrote:


On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:

Hi gang:

I'm entertaining how to determine what zip codes fall within a 50
mile radius of another zip code.

Anyone done this before?

Also, does anyone have any sources for zip codes and lat/long  
databases?


   Tedd,

   I have all of this in a MySQL database already, with census
information, water table info, and more.  If you want to take a look,
let me know and I'll give you a peek via phpMyAdmin to see if it'll
match your needs.

   For you, it's free.  All else must PAY  ;-P


You know...

in the mailing industry people pay $1,000 a year for that kind of  
info? Master Brown? :) ole Buddy, ole Pal :) any chance I could sneak  
a peak at it? Maybe I need to look into writing my own geo mapping  
software...


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]

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



Re: [PHP] zip codes and lat/longs

2007-12-06 Thread Daniel Brown
On Dec 6, 2007 10:49 AM, Jason Pruim <[EMAIL PROTECTED]> wrote:
>
> On Dec 6, 2007, at 10:29 AM, Daniel Brown wrote:
>
> > On Dec 5, 2007 8:58 PM, tedd <[EMAIL PROTECTED]> wrote:
> >> Hi gang:
> >>
> >> I'm entertaining how to determine what zip codes fall within a 50
> >> mile radius of another zip code.
> >>
> >> Anyone done this before?
> >>
> >> Also, does anyone have any sources for zip codes and lat/long
> >> databases?
> >
> >Tedd,
> >
> >I have all of this in a MySQL database already, with census
> > information, water table info, and more.  If you want to take a look,
> > let me know and I'll give you a peek via phpMyAdmin to see if it'll
> > match your needs.
> >
> >For you, it's free.  All else must PAY  ;-P
>
> You know...
>
> in the mailing industry people pay $1,000 a year for that kind of
> info? Master Brown? :) ole Buddy, ole Pal :) any chance I could sneak
> a peak at it? Maybe I need to look into writing my own geo mapping
> software...
>

You sell it, you can have 50% of whatever revenue it generates,
without having to do a bit of code.

It took me over a year to compile all of the information.  I know
I probably could've found it somewhere else for a few hundred dollars,
but I wanted to do it as a project for myself so I did.  ;-P

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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



  1   2   >