php-general Digest 16 Aug 2004 03:34:22 -0000 Issue 2939

Topics (messages 193883 through 193915):

Re: Need help with some logic and how to do it in PHP
        193883 by: Brent Clements

Upload problems
        193884 by: Rosen
        193885 by: raditha dissanayake
        193886 by: Jason Wong
        193888 by: Rosen
        193896 by: Kim Steinhaug
        193897 by: Robby Russell
        193898 by: Curt Zirzow

Re: Help with Regular Expressions
        193887 by: Octavian Rasnita

Re: Anyone know of a PHP Dictionary [Code] Generator
        193889 by: John Holmes

newbie again, submit buttons don't work
        193890 by: yawstick
        193891 by: Ed Lazor
        193895 by: yawstick
        193914 by: Ligaya Turmelle

Re: How to determine if date/time is with DST or not ?
        193892 by: -{ Rene Brehmer }-

Re: code
        193893 by: Justin Patrin

Re: looking for a good FormMail PHP script
        193894 by: Juan Nin
        193899 by: Hannes Magnusson
        193902 by: raditha dissanayake

Compile
        193900 by: Watty
        193903 by: raditha dissanayake
        193905 by: Hannes Magnusson
        193908 by: Louie Miranda
        193910 by: Hannes Magnusson
        193912 by: Hannes Magnusson
        193913 by: Louie Miranda
        193915 by: raditha dissanayake

How to get mime type from file name
        193901 by: C.F. Scheidecker Antunes
        193904 by: raditha dissanayake
        193906 by: Hannes Magnusson
        193911 by: Hannes Magnusson

Re: PHP bug tracker, it is freely available
        193907 by: Jean-Christian Imbeault

Re: PHP templates
        193909 by: Justin French

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Sweet, that solves my problem. Thanks for the help.

-Brent
----- Original Message ----- 
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 15, 2004 9:53 AM
Subject: Re: [PHP] Need help with some logic and how to do it in PHP


> On Sunday 15 August 2004 22:44, Brent Clements wrote:
>
> > I have 7 string values, if any number of them are the same, I need to
ouput
> > that value, if they are all different, I need to output a blank string
"".
> > How would I do this in php outside of writing a huge if/then statement?
> > This is a variation of my "String compare of 7 text strings" question
> > yesterday. All of the 7 string values are values in an array, ie
$strings
> > = array($string1, $string2, $string3, $string4, $string5, $string6,
> > $string7);
>
> array_count_values()
>
> -- 
> 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
> ------------------------------------------
> /*
> An infallible method of conciliating a tiger is to allow oneself to be
> devoured.
> -- Konrad Adenauer
> */
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hi,
I try to upload a .zip file via PHP. I change directive "upload_max_filesize
= 500M".
The first file is about 5 MB and no problems with upload.
The second file is about 17 MB and script doesn't do nothing - no upload :(

Can someone help with this ?

Thanks in advance!

--- End Message ---
--- Begin Message ---
Rosen wrote:

Hi,
I try to upload a .zip file via PHP. I change directive "upload_max_filesize
= 500M".
The first file is about 5 MB and no problems with upload.
The second file is about 17 MB and script doesn't do nothing - no upload :(

Can someone help with this ?


upload_max_filesize setting alone will not do because there are several other settings that need to be considered. These are discussed at http://www.radinks.com/upload/config.php (shameless plug).


-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
On Sunday 15 August 2004 23:14, Rosen wrote:

> I try to upload a .zip file via PHP. I change directive
> "upload_max_filesize = 500M".
> The first file is about 5 MB and no problems with upload.
> The second file is about 17 MB and script doesn't do nothing - no upload :(

Have you read the chapter "manual > Handling file uploads" thoroughly? In 
particular the section "Common Pitfalls"? Also the archives have alot of info 
on this type of problem.

-- 
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
------------------------------------------
/*
Never be led astray onto the path of virtue.
*/

--- End Message ---
--- Begin Message ---
Thanks,
I change the "post_max_size" variable in php.ini and it worked !

"Rosen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Hi,
> I try to upload a .zip file via PHP. I change directive
"upload_max_filesize
> = 500M".
> The first file is about 5 MB and no problems with upload.
> The second file is about 17 MB and script doesn't do nothing - no upload
:(
>
> Can someone help with this ?
>
> Thanks in advance!

--- End Message ---
--- Begin Message ---
Just a quick question,

Did you alter the upload_max_filesize to 500MB
and the post_max_size to say 510MB and you succesfully
upload 500MB files from one machine to the server?

I never testes with filesizes that large, but It would be nice to
hear if it accually works without tweaking to much.

I would also think that the general 30sec timout would need to
be altered as moving a 500MB file from /var/ to the users homedirectory
and then do some filechecking on it and such would easilly need
some extra seconds. Not to think of the overhead if many people
upload large files at a time.

Ok, its a vague post this, just looking for some input here, :D

Its like the needle and the haystack, dont know what im exatcly looking
for here, but you never know. I work with large files myself on some
systems, and its always nice to get feedback whatever it is from other
people working with the same stuff.

-- 
Kim Steinhaug
-------------------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
-------------------------------------------------------------------------
www.steinhaug.com - www.easywebshop.no - www.easycms.no www.webkitpro.com
-------------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
On Sun, 2004-08-15 at 13:01, Kim Steinhaug wrote:
> Just a quick question,
> 
> Did you alter the upload_max_filesize to 500MB
> and the post_max_size to say 510MB and you succesfully
> upload 500MB files from one machine to the server?
> 
> I never testes with filesizes that large, but It would be nice to
> hear if it accually works without tweaking to much.
> 
> I would also think that the general 30sec timout would need to
> be altered as moving a 500MB file from /var/ to the users homedirectory
> and then do some filechecking on it and such would easilly need
> some extra seconds. Not to think of the overhead if many people
> upload large files at a time.
> 
> Ok, its a vague post this, just looking for some input here, :D
> 
> Its like the needle and the haystack, dont know what im exatcly looking
> for here, but you never know. I work with large files myself on some
> systems, and its always nice to get feedback whatever it is from other
> people working with the same stuff.
> 
> -- 
> Kim Steinhaug
> -------------------------------------------------------------------------
> There are 10 types of people when it comes to binary numbers:
> those who understand them, and those who don't.
> -------------------------------------------------------------------------
> www.steinhaug.com - www.easywebshop.no - www.easycms.no www.webkitpro.com
> -------------------------------------------------------------------------

500 mb upload? Make sure you have enough tmp space available for that.
When you get that big you might want to consider a different form of
uploading... ala sftp/ftp.

-Robby

-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
* Thus wrote Kim Steinhaug:
> Just a quick question,
> 
> Did you alter the upload_max_filesize to 500MB
> and the post_max_size to say 510MB and you succesfully
> upload 500MB files from one machine to the server?
> 
> I never testes with filesizes that large, but It would be nice to
> hear if it accually works without tweaking to much.

It comes down to these settings:

php's
  post_max_size
  upload_max_filesize

and the webserver's max size of data. the link of raditha's, posted
earlier in this thread, explains all these setting rather well.

> 
> I would also think that the general 30sec timout would need to
> be altered as moving a 500MB file from /var/ to the users homedirectory
> and then do some filechecking on it and such would easilly need
> some extra seconds. Not to think of the overhead if many people
> upload large files at a time.

I'm not sure if the actual move is calculated in the script
execution time, but it would be wise to take that into
consideration when coding. Of course if /var and /usr are on the
same mount (evilness), the time to move that file is very fast.

The only issue you really have with many people uploading large
files is disk space, neither php or apache will not load the whole
file into memory, unless you have the php setting
always_populate_raw_post_data (always == in certain conditions).

There is also the overhead of disk access speed. If a move requires
a copy then delete, having many people uploading files
will slow the whole system down, in many cases.  So if this is the
case, it might be best to configure php to use the tmp upload dir
to use the same mount point as where you're moving the file to.

> 
> Ok, its a vague post this, just looking for some input here, :D

HTH.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

--- End Message ---
--- Begin Message ---
From: <[EMAIL PROTECTED]>

> Hi all,
>
> I am working on a small php script which should do the
> following. I want all the links in the page to be
> preceded by first character and first two characters
> of the link.Please look into the example below for
> more
> clarification.
>
> eg.
> <a href="/code.html">link here</a> to be
> replaced as
> <a href="/c/co/code.html">link here</a>
>
> I guess, this is possible by using regular expressions
> but I am not able to crack the right expression.
>

Hi,

This is not very simple.
The URI which in your example is /code.html can be anything, including
something like m.html.
In that case which would be the first 2 letters?
Or, the URI can be something like m-like.html. In this case the first 2
letters will be "m-" or "ml"?

A good regular expression should work in all situations so it is important
to know what is the desired result, and not to asume that there won't be any
links like "/.html" or something worse.

Teddy

--- End Message ---
--- Begin Message --- Chris Shiflett wrote:
If you do write this, please don't call it a password generator, else
people might use these things for passwords. :-)

Excellent point. This is for creating one-time invitation codes for users to participate in surveys and not for actual passwords.

Thanks to a link posted by someone else, I was able to find a list of nearly 113,000 words between 4 and 12 characters long that can be used. Even though that's a lot of words, as Chris points out above, it would be trivial to write a script to try every combination of the words...

For those interested, here's the simple function to grab a number of words from a text file containing each word on it's own line:

define('WORDCODE_NUMWORDS',2);
define('WORDCODE_SEPERATOR','-');
    function _getWordCode()
    {
        $retval = '';
        $chosenwords = array();

        $file = 'words.txt';
        $fp = fopen($file,'r');
        $fsize = filesize($file);

        for($x=0;$x<WORDCODE_NUMWORDS;$x++)
        {
            $pos = mt_rand(0,$fsize);
            fseek($fp,$pos);
            while(fgetc($fp) != "\n")
            { fseek($fp,--$pos); }
            $chosenwords[] = trim(fgets($fp));
        }

        return implode(WORDCODE_SEPERATOR,$chosenwords);
    }

Anyone thinking of suggesting file() and array_rand() should try it themselves before doing so. ;)

--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
sorry if this gets posted twice, previous attempt had an invalid email
address
I have several scripts that worked on early version of php4 mysql.
They are all similar in that I use a switch($cmd) command to perform save,
edit, delete, and update based on the value of $cmd in the submit buttons.
I've added a line to echo the value of $cmd and it is always blank and none
of my switch cases gets done. I just built box with freebsd apache php mysql
and I have phpwebsite installed and it is working. Just can't figure out
whats ailing my scripts.
Any help will be appreciated.


begin 666 members.php
M/&AT;6P^#0H-"@T*/$)/[EMAIL PROTECTED](CX\9F]N="!F86-E/2)C
M;VUI8R!S86YS(&US+"!A<FEA;"(@/@T*/#\-"B1P<W1A8W0@/2 B;65M8F5R
M<RYP:' B.PT*)'1A8B ](")M96UB97)S(CL-"FEN8VQU9&4@(FQI;FMS+G!H
M<"([#0II;F-L=61E(")C;VYF+G!H<"([#0HD9&)H(#T@;7ES<6Q?8V]N;F5C
M="@D9&)H;W-T+"1D8G5S97(L)&1B<&%S<RD[#0HD9&)C(#T@;7ES<6Q?<V5L
M96-T7V1B*"1D8BPD9&)H*3L-"@T*<W=I=&-H*"1C;60I>PT*"6-A<V4@(D5D
M:[EMAIL PROTECTED]<[EMAIL PROTECTED]"0DD<61B(#T@;7ES<6Q?<75E<GDH(G-E;&5C=" J(&9R
M;VT@)'1A8B!W:&5R92!F;W)M:60@/2 D9F]R;6ED(BD[#0H)"21D870@/2!M
M>7-Q;%]F971C:%]R;W<H)'%D8BD["0T*"0D-"@EC87-E(").97<@16YT<GDB
M.B -"@D@"65C:&\B/&)O9'D^/&9O<FT@;65T:&]D/2=03U-4)R!A8W1I;VX@
M/2 G)'!S=&%C="<@/B([#0H)"65C:&\@(CQC96YT97(^/&@R/DUE;6)E<B!)
M;F9O($5N=')Y($9O<[EMAIL PROTECTED]/CPO8V5N=&5R/CQB/B([#0H)"65C:&\@(CQI
M;G!U="!T>7!E(#T@)VAI9&1E;B<@;F%M92 ]("=F;W)M:60G('9A;'5E(#T@
M)R1D871;,%TG/B([#0H)"65C:&\@(B \=&%B;&4^/'1R/CQT9#Y,87-T($YA
M;64Z/"]T9#X\=&0^(#QI;G!U="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/CPO='(^(CL-"@D)96-H;R B(#QT<CX\=&0^5V]R:R!0:&]N93H@
M/"]T9#X\=&0^/&EN<'5T('1Y<&4@/2=T97AT)R!.04U%/2=W<&AO;F4G('-I
M>F4])S$R)R!V86QU92 ]("<D9&%T6SA=)SX\+W1D/CPO='(^/"]T86)L93XB
M.PT*"0D-"@D):[EMAIL PROTECTED]"1C;60@/3TB161I="!%;G1R>2(I>PT*"0D)96-H;R B
M/&-E;G1E<CX\:[EMAIL PROTECTED]'EP93TG<W5B;6ET)R!N86UE/2=C;60G('9A;'5E
M(#T@)U5P9&%T92!%;G1R>2<^/"]C96YT97(^/&)R/CQB<CX\+V9O<FT^(CL-
M"@D)"0E]#0H)"65L<[EMAIL PROTECTED])"65C:&\@(CQC96YT97(^/&EN<'5T('1Y<&4]
M)W-U8FUI="<@;F%M93TG8VUD)R!V86QU92 ]("=3879E($5N=')Y)SX\+V-E
M;G1E<CX\8G(^/&)R/CPO9F]R;3XB.PT*"0EB<F5A:SL-"@EC87-E(")3879E
M($5N=')Y(CH-"@D)+R\D8V]M;65N=" ](&5R96=?<F5P;&[EMAIL PROTECTED])R(L(EPG
M(B L("1C;VUM96YT*3L-"@D))&9O<FUI9" ]('1I;64H*3L-"@D))&EN<V1B
M(#T@(FEN<V5R="!I;G1O("1T86(@=F%L=65S*"1F;W)M:60L("<D;&YA;64G
M+" G)&9N86UE)RP@)R1A9&1R97-S)RP@)R1C:71Y)RP@)R1S=&%T92<L("<D
M>FEP)RP@)R1H<&AO;F4G+" G)'=P:&]N92<L("<D96UA:6PG*2([#0H)"21U
M<&1B(#T@;7ES<6Q?<75E<GDH)&EN<V1B*3L-"@D-"@EC87-E(")5<&1A=&4@
M16YT<[EMAIL PROTECTED]"0DD8V]M;65N=" ](&5R96=?<F5P;&[EMAIL PROTECTED])R(L(EPG(B L
M("1C;VUM96YT*3L-"@D))'5P9'0@/2 B=7!D871E("1T86(@<V5T("!L;F%M
M93TG)&QN86UE)[EMAIL PROTECTED];64])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&)R
M/EQN(CL-"@D)"21I*RL[#0H)"0E]('=H:6QE("@D:2 \("1N<BD["0T*#0I]
M#0IE8VAO("(\8V5N=&5R/CQF;VYT('-I>F4@/2 G+3(G/CQB/B1A:7)F;V]T
M/&)R/CPO8CX\+V9O;G0^/"]C96YT97(^7&XB.PT*#0H_/@T*/&AR/CQB<CX-
3"CPO0D]$63X-"CPO:'1M;#X-"@``
`
end

--- End Message ---
--- Begin Message ---
Assuming you're using post, add

$cmd = $_POST["cmd"];

Before you use $cmd and see if that makes a difference.  If it does,
register globals is likely disabled which is good.



> -----Original Message-----
> From: yawstick [mailto:[EMAIL PROTECTED]
> Sent: Sunday, August 15, 2004 7:58 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] newbie again, submit buttons don't work
> 
> sorry if this gets posted twice, previous attempt had an invalid email
> address
> I have several scripts that worked on early version of php4 mysql.
> They are all similar in that I use a switch($cmd) command to perform save,
> edit, delete, and update based on the value of $cmd in the submit buttons.
> I've added a line to echo the value of $cmd and it is always blank and
> none
> of my switch cases gets done. I just built box with freebsd apache php
> mysql
> and I have phpwebsite installed and it is working. Just can't figure out
> whats ailing my scripts.
> Any help will be appreciated.
> 

--- End Message ---
--- Begin Message ---
That cured my problem also had to add similar command for all post variables
I also have some links to directly remove a record

<a href = '$php_self/edit/edevents.php?cmd=Remove+Entry&formid=$formid'>
$linkname</a>

is there a similar command for allowing this to work

--- End Message ---
--- Begin Message ---
$cmd = $_GET['cmd'];

Reference:
http://www.php.net/variables.predefined

Respectfully,
Ligaya Turmelle



yawstick wrote:
That cured my problem also had to add similar command for all post variables
I also have some links to directly remove a record

<a href = '$php_self/edit/edevents.php?cmd=Remove+Entry&formid=$formid'>
$linkname</a>

is there a similar command for allowing this to work


--- End Message ---
--- Begin Message ---
which tells you if the locale where the server is was in DST or not on that
date - atleast if I understand the PHP documentation right... since the
timestamps don't contain locale info ... I wanna know if a specific locale
was in DST on that given date .... 

I hate having to work with dates ... I know it basically requires to code
the dst days for the entire globe into the system, but had hoped someone had
already done that .... as much as I hate using others code, this is one
thing I'd rather avoid having to program...


Documented research indicates that on Sun, 15 Aug 2004 10:31:17 +0300,
Burhan Khalid wrote about "Re: [PHP] How to determine if date/time is with
DST or not ?":

>-{ Rene Brehmer }- wrote:
>
>> hi gang
>> 
>> I'm trying to find a simple way to determine if a given date/time is with
>> DST for a given locale at any point in time ... the point is basically to
>> convert date strings into accurate GMT timestamps for storage in the
>> database...
>
>http://www.php.net/date
>
>I (capital i)  Whether or not the date is in daylights savings time    1 if 
>Daylight Savings Time, 0 otherwise.
>
>[ snipped rest ]

-- 
Rene Brehmer
aka Metalbunny

If your life was a dream, would you wake up from a nightmare, dripping of sweat, 
hoping it was over? Or would you wake up happy and pleased, ready to take on the day 
with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/

--- End Message ---
--- Begin Message ---
On 14 Aug 2004 14:42:19 -0000, PHPDiscuss - PHP Newsgroups and mailing
lists <[EMAIL PROTECTED]> wrote:
> Codes attached.
> In this page i used filetype instead of is_dir.
> 
> <?php
> $dir = "jdkcoders/";
> function getfiles($dir)
>  {
>  if (is_dir($dir)) {
>     if ($dh = opendir($dir)) {
>         while (($file = readdir($dh)) !== false)
>                  {  if($file!='.' && $file!='..')
>                                 {
>                                         if(filetype($dir . $file)=='dir')
>                                                 {
>                                                 getfiles($dir."/".$file);

Look at the two above lines. One adds a '/' and the other diesn't. Try
adding it to the first one.

>                                                 }
>                                         else
>                                                 {
> 
>                                                 echo "<br>$file";
> 
>                                                 }
>                                 }
>                  }
>     closedir($dh);
>                  }
>         }
>   }
> getfiles($dir);
> ?>
> 
> Hope you can help me.
> Thanks.
> 
> John Holmes wrote:
> 
> > PHPDiscuss - PHP Newsgroups and mailing lists wrote:
> > > Hello Professionals,
> > > Can anybody help me to open all subdirectories in a directory,
> > > I used is_dir() to check whether it is a dir, and if yes,
> > > I recursively called it with the new dir name.
> > > But  all subdirectories are not open the recursion is not working for more
> > > than 1 level.
> > > I tested it in windows server.
> > > Expecting your help,
> 
> > Expecting your code...
> 
> > Have you looked at the opendir manual page to see if there are any
> > examples, there?
> 

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

--- End Message ---
--- Begin Message ---
Hannes Magnusson wrote:

Are we just suppost to know "Matt Wright's FormMail.pl" ?

Matt Wright's FormMail.pl script is a very well known script, that's been used by thousands of people for several years. So it was very likely that many of the people who read the e-mail knew what I was talking about...

This list consists not only of PHP programmers, but there are also people who know many other languages like Perl, or work administrating servers, etc, so many can know what this script is...

Moreover, the name "FormMail" is quite descriptive, and there are other FormMail scripts written in several languages that acomplish the same task, so not knowing Matt's script does not mean that you don't know what a FormMail script is.. (obviously not everyone knows what a FormMail script does, but obviously not everyone in the list should know about certain topics)

Or are we suppost to google to check that out so we can answear your question?

I don't expect that...

I have many times googled about things that someone asked on a list and I didn't know what it was.. just for me to know what it as, or to see if I could help this person... I don't expect others to do it, but it doesn't mean that someone can't do it either..

but I also expect a more polite reply than "you have obviously not read the PHP manual" or RTFM, since it was definitely and obviously not the case...

I know this list is a bit differente from others, there are many newbies
who use to ask "how do I do this" without RTFM or STFW, and there is a mix of *NIX, Windows and others users, and sometimes that sort of things
, which are always the same, fed up people, but I was not asking some stupid question because of not RTFM...

Anyway, http://pear.php.net/package-search.php?pkg_name=mail&bool=AND&submit=Search any help?

nope, thos are packages for mime decoding (which I have used in other projects), access for pop or imap, or the most simple Mail package which serves for e-mail sending, just like phpMailer would do, or even the mail() function for more simple tasks... but that's not what I want...

I know how to send e-mail, with mail(), with phpMailer or with PEAR::Mail, I want a good and tested FormMail script.. if I don't find one, I'll use my own written, but I don't want to reinvent the wheel..

anyway, I think I'll look in other places... thanks anyway

Juan
--- End Message ---
--- Begin Message ---
On Sun, 15 Aug 2004 16:36:42 -0300
[EMAIL PROTECTED] (Juan Nin) wrote:

> Hannes Magnusson wrote:
> 
> > Are we just suppost to know "Matt Wright's FormMail.pl" ? 
> 
> Matt Wright's FormMail.pl script is a very well known script, that's 
> been used by thousands of people for several years. So it was very 
> likely that many of the people who read the e-mail knew what I was 
> talking about...
> 
> This list consists not only of PHP programmers, but there are also 
> people who know many other languages like Perl, or work administrating 
> servers, etc, so many can know what this script is...
> 
> Moreover, the name "FormMail" is quite descriptive, and there are other 
> FormMail scripts written in several languages that acomplish the same 
> task, so not knowing Matt's script does not mean that you don't know 
> what a FormMail script is.. (obviously not everyone knows what a 
> FormMail script does, but obviously not everyone in the list should know 
> about certain topics)
> 
> >Or are we suppost to google to check that out so we can answear your question?
> 
> I don't expect that...
> 
> I have many times googled about things that someone asked on a list and 
> I didn't know what it was.. just for me to know what it as, or to see if 
> I could help this person... I don't expect others to do it, but it 
> doesn't mean that someone can't do it either..
> 
> but I also expect a more polite reply than "you have obviously not read 
> the PHP manual" or RTFM, since it was definitely and obviously not the 
> case...
I was not trying to be rude, just never heard of this FormMail by Matt Wright and have 
*no* idea how it works so I posted link to pear - in case you were new to PHP. 
Your post just sounded like you were hardcore perl writer trying out PHP.

 - After having googled "FormMail Matt Wright" and checked it out.. ..don't know of 
any compatible PHP scripts, sorry.

 - Hannes
> 
> I know this list is a bit differente from others, there are many newbies
> who use to ask "how do I do this" without RTFM or STFW, and there is a 
> mix of *NIX, Windows and others users, and sometimes that sort of things
> , which are always the same, fed up people, but I was not asking some 
> stupid question because of not RTFM...
> 
> > Anyway, 
> > http://pear.php.net/package-search.php?pkg_name=mail&bool=AND&submit=Search any 
> > help?
> 
> nope, thos are packages for mime decoding (which I have used in other 
> projects), access for pop or imap, or the most simple Mail package which 
> serves for e-mail sending, just like phpMailer would do, or even the 
> mail() function for more simple tasks... but that's not what I want...
> 
> I know how to send e-mail, with mail(), with phpMailer or with 
> PEAR::Mail, I want a good and tested FormMail script.. if I don't find 
> one, I'll use my own written, but I don't want to reinvent the wheel..
> 
> anyway, I think I'll look in other places... thanks anyway
> 
> Juan

--- End Message ---
--- Begin Message --- This mail probably shows how little you know about matt wright's FormMail more than anything else - just to give you an idea it's banned on all shared servers of our ISP.


Juan Nin wrote:

Hannes Magnusson wrote:

Are we just suppost to know "Matt Wright's FormMail.pl" ?


Matt Wright's FormMail.pl script is a very well known script, that's been used by thousands of people for several years. So it was very likely that many of the people who read the e-mail knew what I was talking about...

<trimmed></trimmed>


-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
Is it possible to compile a PHP script? And if so, how?
 
Watty

--- End Message ---
--- Begin Message ---
Watty wrote:

Is it possible to compile a PHP script? And if so, how?


i think you are looking for something like turck mmcache.


Watty





--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/         | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
http://www.zend.com/store/products/zend-encoder.php

On Mon, 16 Aug 2004 01:12:14 +0100
[EMAIL PROTECTED] (Watty) wrote:

> Is it possible to compile a PHP script? And if so, how?
>  
> Watty
> 

--- End Message ---
--- Begin Message ---
no free tools?

On Mon, 16 Aug 2004 02:37:48 +0200, Hannes Magnusson <[EMAIL PROTECTED]> wrote:
> http://www.zend.com/store/products/zend-encoder.php
> 
> On Mon, 16 Aug 2004 01:12:14 +0100
> [EMAIL PROTECTED] (Watty) wrote:
> 
> > Is it possible to compile a PHP script? And if so, how?
> >
> > Watty
> 
> 
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Louie Miranda
http://www.axishift.com

--- End Message ---
--- Begin Message ---
On Mon, 16 Aug 2004 09:01:54 +0800
[EMAIL PROTECTED] (Louie Miranda) wrote:

> no free tools?
I belive there are some, don't know there name thou. Ask google, should take more then 
2min to find out there names.

> 
> On Mon, 16 Aug 2004 02:37:48 +0200, Hannes Magnusson <[EMAIL PROTECTED]> wrote:
> > http://www.zend.com/store/products/zend-encoder.php
> > 
> > On Mon, 16 Aug 2004 01:12:14 +0100
> > [EMAIL PROTECTED] (Watty) wrote:
> > 
> > > Is it possible to compile a PHP script? And if so, how?
> > >
> > > Watty
> > 
> > 
> > >
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> 
> 
> -- 
> Louie Miranda
> http://www.axishift.com

--- End Message ---
--- Begin Message ---
Why did you reply me directly?
Anyway. I suppose you can find similar programs for free, just google'em

From: "Watty" <[EMAIL PROTECTED]>
To: "'Hannes Magnusson'" <[EMAIL PROTECTED]>
Subject: RE: [PHP] Re: Compile
Date: Mon, 16 Aug 2004 01:58:37 +0100
X-Mailer: Microsoft Outlook, Build 10.0.2616

Haha at a mere $960

> -----Original Message-----
> From: Hannes Magnusson [mailto:[EMAIL PROTECTED]
> Sent: 16 August 2004 01:38
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Compile
> 
> http://www.zend.com/store/products/zend-encoder.php
> 
> On Mon, 16 Aug 2004 01:12:14 +0100
> [EMAIL PROTECTED] (Watty) wrote:
> 
> > Is it possible to compile a PHP script? And if so, how?
> >
> > Watty
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



On Mon, 16 Aug 2004 01:12:14 +0100
[EMAIL PROTECTED] (Watty) wrote:

> Is it possible to compile a PHP script? And if so, how?
>  
> Watty
> 

--- End Message ---
--- Begin Message ---
try this:

http://turck-mmcache.sourceforge.net/


-- 
Louie Miranda
http://www.axishift.com

--- End Message ---
--- Begin Message ---
Louie Miranda wrote:

no free tools?


did you type in turck mmcahce into google before sending this?


-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
Hello,

Is there any function where I can pass a file name like "file.png" and get return the string of its type 'image/png' ?

Basically it is a funcion that takes a file name and returns a string of its mime type.

I have used mime_mail to send attachments but the I need when I am attaching the file to know its mime type, for instance a zip file or a jpg or a txt etc.

Thanks in advance for the help.
--- End Message ---
--- Begin Message ---
C.F. Scheidecker Antunes wrote:

Hello,

Is there any function where I can pass a file name like "file.png" and get return the string of its type 'image/png' ?

Basically it is a funcion that takes a file name and returns a string of its mime type.

I have used mime_mail to send attachments but the I need when I am attaching the file to know its mime type, for instance a zip file or a jpg or a txt etc.

Thanks in advance for the help.

there may be better ways but what I usually do is a get a little help from the mime.types file that is part of apache.


-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
What happend to "RTFM" ? Is that not "cool" anymore?
http://www.php.net/manual/en/ref.mime-magic.php now, R-T-F-M !

- Hannes

On Sun, 15 Aug 2004 18:18:29 -0600
[EMAIL PROTECTED] (C.F. Scheidecker Antunes) wrote:

> Hello,
> 
> Is there any function where I can pass a file name like "file.png" and 
> get return the string of its type 'image/png' ?
> 
> Basically it is a funcion that takes a file name and returns a string of 
> its mime type.
> 
> I have used mime_mail to send attachments but the I need when I am 
> attaching the file to know its mime type, for instance a zip file or a 
> jpg or a txt etc.
> 
> Thanks in advance for the help.

--- End Message ---
--- Begin Message ---
First of, do not mail me directly, post to the news group!

2nd: http://www.php.net/manual/en/function.mime-content-type.php
[snip]
mime_content_type
(PHP 4 >= 4.3.0, PHP 5)
[/snip]
Which mean: You need *at least* PHP4.3.0 for this extension.

3rd:
http://www.php.net/manual/en/ref.mime-magic.php
[snip]
Installation

You must compile PHP with the configure switch --with-mime-magic to get support for 
mime-type functions. The extension needs a copy of the simplified magic file that is 
distributed with the Apache httpd.

    Note: The configure option has been changed from --enable-mime-magic to 
--with-mime-magic since PHP 4.3.2 
[/snip]
Which mean: You need to compile PHP with this switch.

4th: http://pecl.php.net/package/fileinfo


From: "C.F. Scheidecker Antunes" <[EMAIL PROTECTED]>
To: Hannes Magnusson <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: How to get mime type from file name
Date: Sun, 15 Aug 2004 18:40:10 -0600
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510

Hannes,

Thanks but I have checked the manual as well, my PHP is version 4.3.6 however the 
function mime_content_type() is not there.
Besides that, systems without php 4.3 or higher do not support it.

Therefore, maybe I should write a function to read it from /etc/mime.types.

Unless there is something easier.

Thanks.

Hannes Magnusson wrote:What happend to "RTFM" ? Is that not "cool" anymore?
http://www.php.net/manual/en/ref.mime-magic.php now, R-T-F-M !

- Hannes

On Sun, 15 Aug 2004 18:18:29 -0600
[EMAIL PROTECTED] (C.F. Scheidecker Antunes) wrote:

  Hello,

Is there any function where I can pass a file name like "file.png" and 
get return the string of its type 'image/png' ?

Basically it is a funcion that takes a file name and returns a string of 
its mime type.

I have used mime_mail to send attachments but the I need when I am 
attaching the file to know its mime type, for instance a zip file or a 
jpg or a txt etc.

Thanks in advance for the help.
    
  
On Sun, 15 Aug 2004 18:18:29 -0600
[EMAIL PROTECTED] (C.F. Scheidecker Antunes) wrote:

> Hello,
> 
> Is there any function where I can pass a file name like "file.png" and 
> get return the string of its type 'image/png' ?
> 
> Basically it is a funcion that takes a file name and returns a string of 
> its mime type.
> 
> I have used mime_mail to send attachments but the I need when I am 
> attaching the file to know its mime type, for instance a zip file or a 
> jpg or a txt etc.
> 
> Thanks in advance for the help.

--- End Message ---
--- Begin Message ---
Christian Stocker wrote:

http://cvs.php.net/php-bugs-web/

Thanks!

Now, is there any installation documentation? ;) Can't seem to find any under php-bugs-web.

Jc
--- End Message ---
--- Begin Message ---
On 15/08/2004, at 7:02 AM, Octavian Rasnita wrote:

Hi all,

I have seen that there are many templating systems for PHP. Which is the
most used and the best you have found?
Can you recommend me a free and good templating system?

Ultimately it depends on who is going to be building those templates. Is it a HTML programmer, or a Dreamweaver monkey, or is it you (a PHP programmer)?

It's a very old argument that has been done to death on this list 100's of times, but PHP *is a templating language* itself.

<h1><?=$title?></h1>
<table>
        <thead>
                <td>Name</td>
                <td>Email</td>
        </thead>
        <? foreach($users as $user): ?>
        <tr>
                <td><?=$user['name']?></td>
                <td><?=$user['email']?></td>
        </tr>
        <? endforeach; ?>
</table>

Personally, I prefer to just use PHP wherever possible. The reality is that Smarty et al all compile or parse these templates into PHP at some point, so my question is, why not just use PHP? You'll eventually run into limitations with any other template language ("you can't do that with smarty").


However, templating languages are PERFECT in an environment where the programmer (you) doesn't want to give the template designer (someone else) the full power of PHP.

Others have (and probably will again) argue that the templating languages like Smarty are easier for the designer to learn, but I completely disagree. I can't see any benefits -- check out the following examples:

{$name|capitalize}
{$smarty.now|date_format:"%Y-%m-%d"}
<table>
{section name=mysec loop=$users}
{strip}
   <tr bgcolor="{cycle values="#aaaaaa,#bbbbbb"}">
      <td>{$users[mysec].name}</td>
      <td>{$users[mysec].phone}</td>
   </tr>
{/strip}
{/section}
</table>

These all look just as simple and easy in PHP:

<?=capitalize($name)?>
<?=date('Y-m-d')?>
<table>
<? foreach($users as $user): ?>
   <tr bgcolor="<?=cycle("#aaaaaa","#bbbbbb")?>">
      <td><?=$user['name']?></td>
      <td><?=$user['phone']?></td>
   </tr>
<? endforeach; ?>
</table>


Yes, I'd have to have a library of various functions like capitalize() and cycle(), but this is all rudimentary stuff that could be achieved very quickly -- in fact, I've already got most of them written.


Now, to pre-empt a flame by many of Smarty's fans, Smarty does offer many other advantages (caching, restricted power, encourages separation of code and presentation, etc).

As I said right back at the start, it depends on who the target author of the templates will be, and what skills they have. I've spent a lot of time in Smarty, Textpattern's XHTML based template language and many more, and in most cases *I* would prefer straight PHP, but you need to spend a little time with them and decide for yourself, based on your own needs.



---
Justin French
http://indent.com.au

--- End Message ---

Reply via email to