[PHP] Re: How to determine if date/time is with DST or not ?

2004-08-15 Thread Torsten Roehr
"-{ Rene Brehmer }-" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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...
>
> Like I've got date strings looking like:
>
> Thursday, July 22, 2004 8:50:01 PM
> July 22, 2004 6:42 PM
>
> the strings are submitted through a form, together with a variable
> determining the time zone these times are in. I just want to figure out if
> the dates are with or without dst for that locale, at that given time, so
> that I can properly convert them to GMT times ... but I have no clue how
to
> do that ... haven't been able to find anything useful in the manual or the
> PHP Cookbook ... the time zone is submitted negative of the actual value
...
> so a time offset of -0700 is submitted as +7 and +0200 as -2 ... this is
> simply to make the time conversion simpler...
>
> these are extracts of the current time calculation codes, including some
> debugging code for the time conversion:
>
>$date = $_POST['date'];
>   $tzone = $_POST['tzone'];
>
>   $timestamp = strtotime($date);
>
>   if ($tzone != 'none') {
> $tdif = $tzone.' hours';
> $timestamp = strtotime($tdif,$timestamp);
>   }
> ?>
>
> /* the following part is an extra of a larger table ... the formatting of
> the time zone is merely for displaying purposes atm. The goal is to create
> RFC2822 dates to be stored in the database alongside messages...
> */
>
> Workdate: 
>   Time difference:  if ($tzone > 0) {
>   $format = '-';
> } else {
>   $format = '+';
> }
> if (abs($tzone) > 9) {
>   $format .= '%u00';
> } else {
>   $format .= '0%u00';
> }
> printf($format,abs($tzone)); ?>
>   Unix timestamp: 
>   GMT date: 
>
>
> if anyone has any ideas for determining whether DST is on or off, I'd
> appreciate it. right now I have no clue how to do this the easiest...
>
> TIA
>
> Rene
> --
> 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/

Hi Rene,

I'm not totally sure but I loosely remember this topic being discussed here
some weeks ago. Try your look by searching the mailing list archives.

Best regards, Torsten Roehr

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



Re: [PHP] Kerberos authentication

2004-08-15 Thread Burhan Khalid
Matthew Runo wrote:
I am working on a project that requires Kerberos authentication, 
however - we are unable to use the apache module that one would 
normally use [sys admin.. *grumble*].

I searched the archives to find a script that would authenticate a user 
against a Kerberos server, and found very little. Does anyone have any 
ideas? I'd bow down and be very, very, excited if someone did...
1. Bribe/convince/threaten the sysadmin to install the mod_auth_kerberos 
module

2. Try using DCE [ http://www.opengroup.org/dce/ ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] A function in PHP that changes html in a string from to ?

2004-08-15 Thread Burhan Khalid
Jay Blanchard wrote:
[snip]
Is there any function in PHP that changes html in a string from  to  ? (e.g. adding the double quotes)
[/snip]
Nah, but you could write a function to add quotes to attributes of any
tag that you would like.
Tidy [ http://tidy.sf.net ] can do this
"Tidy inserts quote marks around all attribute values for you. It can 
also detect when you have forgotten the closing quote mark, although 
this is something you will have to fix yourself."

That from http://www.w3.org/People/Raggett/tidy/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How to determine if date/time is with DST or not ?

2004-08-15 Thread Burhan Khalid
-{ 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 ]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Anyone know of a PHP Dictionary Password Generator

2004-08-15 Thread Burhan Khalid
John Holmes wrote:
Anyone know of a PHP english word password generator? Something that'll 
produce easy to read and remember codes like "buffalo_candy" or 
"shipment+plant", etc?

I had a look on phpclasses.org, but didn't find anything like this.
Or, as an alternative, I'll code it myself if anyone can point me to a 
"dictionary" of english words that I could use populate a text file or 
database to choose from.
John,
  On a recent project I had a similar problem, and then I found pwgen [ 
http://sf.net/projects/pwgen/ ] and it worked great. It creates 
passwords that are easy for humans to remember, but difficult for 
machines to guess. It can even create "machine" passwords.

  Here's sample output :
[EMAIL PROTECTED] burhan $ pwgen -n -c -C 8 5
shie9ohG hu8Aengu Thie2ahx Ajien9ai eM2youhu
  With its various options, you can modify the lenth and number of 
passwords generated.  The source code is also available, but I didn't 
have the time to convert it to PHP.

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


Re: [PHP] PHP not working with apache2

2004-08-15 Thread Burhan Khalid
Grant wrote:
I'm running Gentoo Linux, and emerged (installed)
squirrelmail which automatically installed all of its
dependencies including PHP and (I think) mod_php.  PHP
doesn't seem to be working though, as I always end up
looking at the raw PHP code in a browser.  I do have
apache and apache2 installed on my system, and I
suspect some key PHP things may have been set up for
apache instead of apache2.  Does anyone have any
pointers?
In Gentoo, emerge php just installs the client build, emerge mod_php 
installs the Apache module.

Therefore, what you need to do is emerge -av mod_php
Also, emerge apache installs Apache2, eventhough you may see apache and 
apache2 in /etc/

Then edit /etc/conf.d/apache2 and add -D PHP4 to the APACHE2_OPTS variable.
Finally, issue /etc/init.d/apache2 restart
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: [PHP-General List] - Cron or script like Cron -

2004-08-15 Thread francesco[AT]automationsoft[DOT]biz
I'm sorry Hannes, I have seen now that I email only to you and not to the
PHP list.
Sorry.
Thanks.

- Original Message -
From: "Hannes Magnusson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 14, 2004 7:26 PM
Subject: [PHP] Re: [PHP-General List] - Cron or script like Cron -


> Don't mail me directly, no good comes from that.
>
> Anyway, see my answear below.
>  -Hannes
>
> From: "francesco[AT]automationsoft[DOT]biz" <[EMAIL PROTECTED]>
> To: "Hannes Magnusson" <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Re: [PHP-General List] - Cron or script like Cron -
> Date: Sat, 14 Aug 2004 19:03:02 +0200
> X-Mailer: Microsoft Outlook Express 6.00.2800.1106
>
> Hi Hannes,
> I'm not sure that I understand your solution.
> Can explain me well?
> Thank's
>
> > run cron via httpd user? i.e.
> >   fputs STDIN crontab -e blablabla
> can't doit via fputs, was just trying to put in your head some ideas how
to do this.
> can problibly do something like shell_exec ( 'echo "YourNewCronjob" >>
/path/to/nobody/crontab' );
>
> This doesnt have alot todo with php thou.
> >
> > - Hannes
> >
> > On Sat, 14 Aug 2004 18:34:10 +0200
> > [EMAIL PROTECTED] (FrancescoAutomationsoftBiz) wrote:
> >
> > > Hi all,
> > > I have a script that generate a benchmark report, in *.csv, every day.
> > > I want to have the possibility to send me this report every day at the
> same time, during night, i.e. at the 03.00 am. I know that there is Cron
> that give me the possibility to do this, but I'm not the server manager
and
> I cannot use Cron. I find a good alternative script, called Pseudo-Cron,
but
> it runs only when the page that contains script is called.
> > > There is a script that have the same function of Cron but is only php,
> or there is another way to call Cron or anyother way to use Cron?
> > > All helps are very appreciated.
> > > Thank's all.
> > > Francesco
> > > [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
>
>

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



Re: [PHP] Anyone know of a PHP Dictionary Password Generator

2004-08-15 Thread Chris Shiflett
--- John Holmes <[EMAIL PROTECTED]> wrote:
> Anyone know of a PHP english word password generator? Something
> that'll produce easy to read and remember codes like "buffalo_candy"
> or "shipment+plant", etc?
> 
> I had a look on phpclasses.org, but didn't find anything like this.
> 
> Or, as an alternative, I'll code it myself if anyone can point me to a 
> "dictionary" of english words that I could use populate a text file or 
> database to choose from.

Don't the spelling extensions have some sort of dictionary that they use?
You can probably use whatever they use.

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

Chris

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



Re: [PHP] PHP Security Workbook

2004-08-15 Thread Chris Shiflett
--- Burhan Khalid <[EMAIL PROTECTED]> wrote:
> Most of the stuff was common sense to me (and I was glad I
> was doing those things unconsciously).

That's good to hear. :-)

Most of the people that have heard me give this talk (which is a few
hundred now) have realized several vulnerabilities in their current
applications, bad development habits, etc. I actually get tired of giving
the same (or very similar) talks, but I'll keep giving this one as long as
it keeps surprising a lot of the audience. The fewer excuses we give
people to equate PHP with poor security, the better off we'll all be.

>  However, I do have issue with one paragraph:
> 
> Page 29,
> 
> * Using POST rather than GET in forms.
> 
> "Specify POST in the method attribute of your forms.  Of course, this 
> isn't appropriate fot all your forms, but it is appropriate when a form 
> is performing an action, such as buying stocks. In fact, the HTTP 
> specification requires that GET be considered safe."
> 
> Don't you mean "In fact, the HTTP specification requires that POST be 
> considered safe?" Didn't make sense to me when I read it last night.

Nope, it's correct as written. Perhaps it just needs to be rephrased, or
maybe I need to elaborate about what "safe" means in this context.

The piece of the HTTP specification I'm referring to is within section
9.1.1 of RFC 2616, entitled "Safe Methods," and it has the following to
say:

   "In particular, the convention has been established that the GET and
   HEAD methods SHOULD NOT have the significance of taking an action
   other than retrieval. These methods ought to be considered "safe".
   This allows user agents to represent other methods, such as POST, PUT
   and DELETE, in a special way, so that the user is made aware of the
   fact that a possibly unsafe action is being requested."

Thus, as developers, we should never perform an action when the request
method is GET. This means that forms intended to perform actions such as
buying stocks should specify the POST method, and we should also not rely
on register_globals or $_REQUEST, because both of these hide whether the
data we are using was sent in a GET request or a POST request. Specify
POST, and use $_POST.

Hope that clarifies what I mean a bit. Of course, I elaborate more in the
actual talk; this was just the workbook for people to reference and take
home to help remember the points. I just decided to give it away, since I
had put so much work into it. :-)

But, I'm always looking for improvements. I'll try to add a bit of
clarification in there somehow.

Thanks for the feedback.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] PHP Security Workbook

2004-08-15 Thread Octavian Rasnita
I have also read that pdf document and I have found another interesting
advice.

The author says that a good way of hiding the username/password is to put a
file that exports 2 environment variables in a directory that can be read
only by the root, then include a call to that file in httpd.conf in order to
let the web server to have access to those variables.

Well, I don't really understand why this is so secure.

I understand that the web server is run by root, which sees that file and
exports the variables, then another user without many priviledges runs the
child process of the web server, but if there are more than one user that
run PHP files or files made in other languages on that server, they will
also be able to see those environment variables.

Did I understand correctly?
Teddy

- Original Message -
From: "Chris Shiflett" <[EMAIL PROTECTED]>
To: "Burhan Khalid" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, August 15, 2004 4:05 PM
Subject: Re: [PHP] PHP Security Workbook


> --- Burhan Khalid <[EMAIL PROTECTED]> wrote:
> > Most of the stuff was common sense to me (and I was glad I
> > was doing those things unconsciously).
>
> That's good to hear. :-)
>
> Most of the people that have heard me give this talk (which is a few
> hundred now) have realized several vulnerabilities in their current
> applications, bad development habits, etc. I actually get tired of giving
> the same (or very similar) talks, but I'll keep giving this one as long as
> it keeps surprising a lot of the audience. The fewer excuses we give
> people to equate PHP with poor security, the better off we'll all be.
>
> >  However, I do have issue with one paragraph:
> >
> > Page 29,
> >

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



Re: [PHP] PHP Security Workbook

2004-08-15 Thread Chris Shiflett
--- Octavian Rasnita <[EMAIL PROTECTED]> wrote:
> I have also read that pdf document and I have found another
> interesting advice.
> 
> The author says that a good way of hiding the username/password
> is to put a file that exports 2 environment variables in a directory
> that can be read only by the root, then include a call to that file in
> httpd.conf in order to let the web server to have access to those
> variables.

I can't take credit for thinking of this approach. This comes from David
Sklar and Adam Trachtenberg, authors of PHP Cookbook (and others).

> Well, I don't really understand why this is so secure.
> 
> I understand that the web server is run by root, which sees that file
> and exports the variables, then another user without many
> priviledges runs the child process of the web server, but if there are
> more than one user that run PHP files or files made in other
> languages on that server, they will also be able to see those
> environment variables.
> 
> Did I understand correctly?

Yes, this is another thing that I mention in the talk but failed to
include in the workbook. When this approach is being applied to a shared
hosting environment, you want to put the Include directive within a
VirtualHost block of httpd.conf, so that it only applies to a single
virtual host.

Also, each unprivileged child process that handles requests for this
virtual host has this sensitive information in memory. So, while the data
is safer, it is not completely safe (nothing is). If a user can exploit a
vulnerability in your application that lets them execute arbitrary code,
they can access this data. Of course, they can do a lot of bad things in
this case. :-)

Hope that clarifies. Thanks for the feedback.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] PHP Security Workbook

2004-08-15 Thread Octavian Rasnita
Oh thank you for this information. This is very important for me to know.

> Yes, this is another thing that I mention in the talk but failed to
> include in the workbook. When this approach is being applied to a shared
> hosting environment, you want to put the Include directive within a
> VirtualHost block of httpd.conf, so that it only applies to a single
> virtual host.
> 

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



[PHP] Need help with some logic and how to do it in PHP

2004-08-15 Thread Brent Clements
I have the following problem.

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);

Thanks,
Brent

[PHP] Re: Help with Regular Expressions

2004-08-15 Thread killu0007-widget
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. 
link here to be
replaced as 
link here

I guess, this is possible by using regular expressions
but I am not able to crack the right expression.

Any help would be highly appreciated in this
regards.

Cheers,
Killu


Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

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



Re: [PHP] Need help with some logic and how to do it in PHP

2004-08-15 Thread Jason Wong
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



Re: [PHP] Need help with some logic and how to do it in PHP

2004-08-15 Thread Brent Clements
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
>
>

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



[PHP] Upload problems

2004-08-15 Thread Rosen

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!

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



Re: [PHP] Upload problems

2004-08-15 Thread raditha dissanayake
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Upload problems

2004-08-15 Thread Jason Wong
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.
*/

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



Re: [PHP] Re: Help with Regular Expressions

2004-08-15 Thread Octavian Rasnita
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.
> link here to be
> replaced as
> link here
>
> 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

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



[PHP] Re: Upload problems

2004-08-15 Thread Rosen
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!

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



Re: [PHP] Anyone know of a PHP Dictionary [Code] Generator

2004-08-15 Thread John Holmes
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
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] newbie again, submit buttons don't work

2004-08-15 Thread yawstick
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+"!APT*"6-A7-Q;%]F971C:%]R;W7!E(#TG=&5X="<@3D%-13TG;&YA;64G
M('-I>F4])S(U)R!V86QU92 ]("'0G($Y!344])V%D9')EF4])S4P)R!V86QU92 ]("'0G($Y!344])WII<"<@F4])S$R)R!V86QU92 ]("F4])S$R)R!V86QU92 ]("2<^/"]C96YT97(^/&)R/CQBFEP)RP@)R1H<&AO;F4G+" G)'=P:&]N923TG)&-I='DG+"!S=&%T93TG)'-T871E)RP@>FEP/2FEP)RP@
M:'!H;VYE/27-Q
M;"@D9&(L("1U<&1T*3L-"@D)#0H)9&5F875L=#H-"@D):[EMAIL PROTECTED]"1C;60@/3T@
M(E)E;6]V92!%;G1R>2(I>PT*"0D))')D;2 ](&UY7-Q;%]Q=65R>[EMAIL PROTECTED]2!L;F%M92(I.R @(" @(" @(" @(" -"@D))&YR
M(#T@;7ES<6Q?;G5M7W)O=W,H)'%D8BD[#0H)"21I(#T@(C B.PT*"0EE8VAO
M("(\:'(^/&)R/B([#0H)"61O('L-"@D)"21D871A(#T@;7ES<6Q?9F5T8VA?
M2 ]("1D871A6S1=.PT*"0D))'-T
M871E(#T@)&1A=&%;-5T[#0H)"0DD>FEP(#T@)&1A=&%;-ET[#0H)"0DD:'!H
M;VYE(#T@)&1A=&%;-UT[#0H)"0DD=W!H;VYE(#T@)&1A=&%;.%T[#0H)"0DD
M96UA:6P@/2 D9&%T85LY73L-"@D)"0T*"0D))&9D([EMAIL PROTECTED]&[EMAIL PROTECTED]"!-(&0@
M:#IM(BPD9F]R;6ED*3L-"@D)"65C:&\@(CQF;W)M(&UE=&AO9#TG4$]35"<@
M86-T:6]N(#T@)R1P2P@)'-T871E("1Z
M:7 @/&)R/EQN(CL-"@D)"65C:&\@(B!(;VUE(%!H;VYE.B D:'!H;VYE(#QB
M7!E/2=S=6)M:70G
M(&YA;64])V-M9"<@=F%L=64@/2 G3F5W($5N=')Y)SX\:[EMAIL PROTECTED]'EP92 ]
M)W-U8FUI="<@;F%M93TG8VUD)R!V86QU92 ]("=%9&ET($5N=')Y)SX\:6YP
[EMAIL PROTECTED]'EP92 ])W-U8FUI="<@;F%M93TG8VUD)R!V86QU92 ]("=296UO=F4@
M16YTF4@/2 G+3(G/CQB/B1A:7)F;V]T
M/&)R/CPO8CX\+V9O;G0^/"]C96YT97(^7&XB.PT*#0H_/@T*/&AR/CQBhttp://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] newbie again, submit buttons don't work

2004-08-15 Thread Ed Lazor
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.
> 

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



Re: [PHP] How to determine if date/time is with DST or not ?

2004-08-15 Thread -{ Rene Brehmer }-
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 time1 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/

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



Re: [PHP] code

2004-08-15 Thread Justin Patrin
On 14 Aug 2004 14:42:19 -, PHPDiscuss - PHP Newsgroups and mailing
lists <[EMAIL PROTECTED]> wrote:
> Codes attached.
> In this page i used filetype instead of is_dir.
> 
>  $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 "$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--

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



Re: [PHP] looking for a good FormMail PHP script

2004-08-15 Thread Juan Nin
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] newbie again, submit buttons don't work

2004-08-15 Thread yawstick
That cured my problem also had to add similar command for all post variables
I also have some links to directly remove a record


$linkname

is there a similar command for allowing this to work

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



[PHP] Re: Upload problems

2004-08-15 Thread 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.

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
-

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



Re: [PHP] Re: Upload problems

2004-08-15 Thread Robby Russell
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
/



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


Re: [PHP] Re: Upload problems

2004-08-15 Thread Curt Zirzow
* 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!

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



Re: [PHP] looking for a good FormMail PHP script

2004-08-15 Thread Hannes Magnusson
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

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



[PHP] Compile

2004-08-15 Thread Watty
Is it possible to compile a PHP script? And if so, how?
 
Watty


[PHP] How to get mime type from file name

2004-08-15 Thread C.F. Scheidecker Antunes
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] looking for a good FormMail PHP script

2004-08-15 Thread raditha dissanayake
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...


--
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Compile

2004-08-15 Thread raditha dissanayake
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How to get mime type from file name

2004-08-15 Thread raditha dissanayake
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Compile

2004-08-15 Thread Hannes Magnusson
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



[PHP] Re: How to get mime type from file name

2004-08-15 Thread Hannes Magnusson
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.

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



Re: [PHP] PHP bug tracker, it is freely available

2004-08-15 Thread Jean-Christian Imbeault
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Compile

2004-08-15 Thread Louie Miranda
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

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



Re: [PHP] PHP templates

2004-08-15 Thread Justin French
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.




Name
Email








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"}

{section name=mysec loop=$users}
{strip}
   
  {$users[mysec].name}
  {$users[mysec].phone}
   
{/strip}
{/section}

These all look just as simple and easy in PHP:




   ">
  
  
   


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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Compile

2004-08-15 Thread Hannes Magnusson
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

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



[PHP] Re: How to get mime type from file name

2004-08-15 Thread Hannes Magnusson
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.

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



[PHP] Re: Compile

2004-08-15 Thread Hannes Magnusson
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
> 

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



Re: [PHP] Re: Compile

2004-08-15 Thread Louie Miranda
try this:

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


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

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



Re: [PHP] newbie again, submit buttons don't work

2004-08-15 Thread Ligaya Turmelle
$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

$linkname
is there a similar command for allowing this to work

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

Re: [PHP] Re: Compile

2004-08-15 Thread raditha dissanayake
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: How to get mime type from file name

2004-08-15 Thread raditha dissanayake
Hannes Magnusson wrote:
First of, do not mail me directly, post to the news group!
 

Hannes,
when someone mails you direct to request additional help the only 
acceptable response IMHO is the cold shoulder.

--
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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Compile

2004-08-15 Thread Octavian Rasnita
From: "raditha dissanayake" <[EMAIL PROTECTED]>


> i think you are looking for something like turck mmcache.
> 

Do you know if Turck MMCache works with PHP 5.0?

Teddy

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



Re: [PHP] PHP templates

2004-08-15 Thread Octavian Rasnita
Hi,

I took a look to Smarty and Savant templating systems, and  I like a few
things from both of them.
However, none of them are satisfactory.

I don't like Smarty because it needs another language and I find Savant more
easy to use.

I would like to have a templating system that:
1. Separates:
- the programming part (the main programs and the modules)
- the structure and main design of the site (the templates)
- The content of the site, this meaning the body text, the title, keywords,
and all other variables.
- Other files that can be included, like Javascript, .css, images, files
that can be downloaded, etc.

2. The templates should handle more languages, and all the content parts
should be able to appear in every language supported.

3. The program should be able to create a cache but not one containing PHP,
but one that is just simple html that can be loaded from a cached file and
presenting to the client.
(I don't know how to decide yet when to re-create the cached file)

If someone uses this templating system, someone can modify the design by
modifying the templates and this change will be reflected in every language.
If a translator add a new language or modifies a certain translation, the
design won't be affected.
The programmer could add a new program for a new page that does something
new, or new modules, etc.

I couldn't find such a thing yet and I think I will have to create it.

Teddy

- Original Message - 
From: "Justin French" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, August 16, 2004 4:38 AM
Subject: Re: [PHP] PHP templates


> 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?

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