[PHP] Re: Browser Detection & Redirection -- PHP or Apache ???

2001-08-19 Thread Lutz Horn

* Christopher Raymond [Fri, 17 Aug 2001 16:14:40 -0500]:
> For example: I don't want users with browsers less than 4.0 to
> actually load a page on our site. Instead, I want them redirected to a
> page that let's them know their browser is in-compatible.

Why do you want to do this? If a browser can't display your page because
you use Java/Flash/whatever, it's not the user's browsers that is
incompatible but your page design.

Please take a look at the W3C's Web Accessibility Initiative, found
under:

  http://www.w3.org/WAI/

Regards
Lutz
-- 
** Please read these useful resources. **
Java Anon Proxy: http://anon.inf.tu-dresden.de/
Attribution FAQ: http://www.math.fu-berlin.de/~guckes/faq/attribution.html
Signature FAQ:   http://www.math.fu-berlin.de/~guckes/message/sig.etiquette.html

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




[PHP] Re:if else

2001-08-19 Thread nafiseh saberi


hi.
use only 
at the end and first line to work better and not crowd.

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




[PHP] transaction

2001-08-19 Thread nafiseh saberi


hi.
in large database with php,postgres
and when in each time come many request ,
how do we implement transactions??
nafiseh.

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




[PHP] mysql , postgres

2001-08-19 Thread nafiseh saberi


hi.
why most of you , use mysql and not
postgres?
nafiseh.

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




Re: [PHP] Protecting include files

2001-08-19 Thread Tom Carter

In addition to this you can place the file out of the web tree PHP can,
AFAIK, include files based on their absolute file path, eg /home/config.inc.
This means that there is no way to directly browse to a file

(web tree is the part of a server/whatever that the webserver (eg apache)
uses to load files when requested to)

> Hi,
>
> I have a php script which includes .inc files. Is there any way in which I
> can prevent a normal surferfrom viewing these files. Is there any command
> that I can add to a .htaccess file.
>
> Thanks
>
>   ~~~  \\__
> ! SIDDHARTH HEGDE /   CHAOSGAMERZ.COM !
> !  Webmaster  \  For PC Game screeshots, cheat!
> !   http://www.ChaosGamerz.COM o| o  codes, trainers, downloads,  !
> ![EMAIL PROTECTED]( |_   game music, FREE e-mail and even !
> ! ICQ 84475206 |--   FREE FULL VERSION games for that !
> ~~ \___/ 486--
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




[PHP] Files from db vs. filesystem (was MySql or flat database using PHP)

2001-08-19 Thread Tom Carter

Andrew/All,

Following on from this I am interested to find out some performance
comparisons/opinions of
storing files in a db vs. storing in the file system and being redirected by
php

I think I've heard from elsewhere that file system is more effecient.

The sistuation storing is pretty much a "one-off" activity, but accesses
will be frequent. Files are small, ranging from 30k to 250k.

Anyone have any comments/benchmarks? My attempts at testing the two have
been sloppy to say the least.

TIA, Tom
- Original Message -
From: "Andrew Libby" <[EMAIL PROTECTED]>
To: "David Ovens" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 3:20 AM
Subject: Re: [PHP] MySql or flat database using PHP ?


>
> Dave,
> IMHO, a major consideration for Web apps is contention and s
> synchronization.  If you intend to allow users to update
> data on in the app it becomes important to coordinate writes
> (with locking) so that no two users can write to the same (region)
> of the file at the same time.  An RDBMS (MySQL, PostgreSQL) or a directory
> (OpenLDAP) takes care of this (as well as many other problems
> with data storage and retrieval).  I agree with the other statements I've
> seen here, but wanted to add this as well.   I've done it both ways
> and the DBMS, Directory route tends to be a better solution.   This is
> code reuse of the best kind.
>
> My humble $0.02.
>
> Andy
>
>
> On Sat, Aug 18, 2001 at 09:29:56PM +0100, David Ovens wrote:
> > Before I start creating an Sql table/database, thought I would ask for
advice first.
> >
> > I am creating a directory online, with urls information, links, email
addresses etc etc.  What do you think is best a MySql database or writing it
to a file using fopen/fwrite (flat file) ???  Your thoughts would be very
much appreciated.
> >
> >
> > Thanks
> >
> > Dave
> >
> >
> >
>
> --
> --
> Andrew Libby
> Director of Technology
> CommNav, Inc
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




Re: [PHP] class variables and methods

2001-08-19 Thread Tom Carter

There was a long discussion on this in a java forum I am part of, the
product of which was basically this...

1. All variables in a class are best left to be private (not sure PHP has
this, but the programmer can work the principle in mind.. that is only the
class can access them).
2. Generic variable access/store methods should be avoided - the principle
is that the internal variable can change name etc. without the external
interface having to worry about it.
3. Method to set/fetch each variable - it may seem a counter intuitive way
of doing it, especially when it is possible to do something "nice" like the
set method below. This seems a very "un-web" way.. and this is where a
difference comes in. Web is not inherently OO, and a lot of the practices of
web programmers are at conflict with more "traditional" apps programmers.
Web tends to go for speed and simplicity, rather than good design etc.
4. Some situations could theoretically arise where it is necessary to set an
unknown amount of variables within a class, however it would be far more
sensible to put these into an array.

In summary, in good OOP you should have a method for every get/set operation
on variables that is required, using arrays as appropiate.

Going back to the original point on whether or not to access the variable
directly or build a set function in, they are both as bad as each other,
just about. They both access variables directly and require the outside
program to have knowledge of variable names etc. and it doesn't allow for
checking for "correct" values being set ( a useful thin with the above
method)

Hope this helps, let me know if I can provide any more advice.

Tom

- Original Message -
From: "Andrew Libby" <[EMAIL PROTECTED]>
To: "Joe Sheble (Wizaerd)" <[EMAIL PROTECTED]>
Cc: "General PHP List" <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 3:34 AM
Subject: Re: [PHP] class variables and methods


> Joe,
> There are varying opinions on this issue.  The argument for
> methods is that it hides the internal structure of your class.  This
> is always a good thing.  This means that the internals of the class
> can be changed, but the user interface (the user is the programmer here)
> does not change.  So this alternative implementation of someclass
>
>
> class someclass

> var $data = false;
>
> function set($key,$val) {
> $this->data[$key] = $val;
> }
> }
>
> is no different the the calling code.  In general, I tend to have an
> accessor/mutator method for each 'property' that I would like to
> provide access to.  I'd have a method for each $key that I want to
> support (this may not apply in your case).
>
> class someclass

> var $name = false;
> var $age  = false;
>
> function name()

> if(func_num_args()) $this->name = func_get_arg(0);
> return $this->name;
> }
>
> function age()

> if(func_num_args()) $this->age= func_get_arg(0);
> return $this->age;
> }
> }
>
> Now, this gets a big annoying to code since the lions share of my
> classes have the name method implementations.  I've been hunting
> for a way to create methods dynamically, but I've only found one.
> To create class definitions on the fly and eval() them.  This
> works great when you've got a huge number of properties
> (class/instance vars).  I'll construct a static method on the
> class that processes examines the class vars (get_class_vars())
> and defines a class extending my implementation.   The
> sub class has the methods implemented for accessing/mutating
> the properties I'd like to have methods for.  If anyone knows
> of a means to do this to an existing class (say using create_function()
> or something), I'd love to hear about it.
>
> Andy
>
>
> On Sat, Aug 18, 2001 at 07:09:08PM -0700, Joe Sheble (Wizaerd) wrote:
> > I've been doing some reading up on OOP in PHP, and looking at some of
the
> > classes available on the web, and I've got what is probably a stupid
> > question.  I've seen this many many times..
> >
> > class someclass {
> > var $somevar = "someval";
> >
> > function set( $key, $val ) {
> > $this->$key = $val;
> > }
> > }
> >
> > $myClass = new someclass;
> > $myClass->set( "somevar", "someotherval" );
> >
> > why write a set method when you can just as easily call
> > $myClass->somevar = "someotherval";
> >
> > Is there a reason for this?
> >
> > Also, alot of the different table classes (an OOP approach to HTML
tables)
> > stores the data in arrays, but at what point is it too much to store
into an
> > array?  Say you have a forum and the text entered for a single respone
could
> > be quite lengthy, much less for 100 replies...  wouldn't that be a bit
much
> > to store into an array?  I know it depends on the system resources, but
is
> > there a practical limit that people follow?
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTE

Re: [PHP] transaction

2001-08-19 Thread Chris Lambert

I believe that'd be a question best suited for the PostgreSQL mailing lists,
since its handled at the database level with "begin" and "commit".

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: nafiseh saberi <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 4:24 AM
Subject: [PHP] transaction


|
| hi.
| in large database with php,postgres
| and when in each time come many request ,
| how do we implement transactions??
| nafiseh.
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


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




Re: [PHP] mysql , postgres

2001-08-19 Thread Chris Lambert

MySQL is easier to use and faster to develop with for 90% of web
applications. Sure, PostgreSQL has some huge advantages, but not everyone
needs the same thing.

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: nafiseh saberi <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 4:24 AM
Subject: [PHP] mysql , postgres


|
| hi.
| why most of you , use mysql and not
| postgres?
| nafiseh.
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


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




[PHP] Count total

2001-08-19 Thread Martin Kampherbeek

Hi,

Who can help me with the following problem?
I have the tables score and totalscore.

Score:
id
userid
name
score

Totalscore:
userid
name
totalscore

In the table score one user can have mutiple scores. But in totalscore the userid is 
unique. Now I want to count all the score's of a user en place this at the same user 
in totalscore.

Example of score:
11Martin10
22John5
33Richard   12
41Martin  3
53Richard8
61Martin  7
72John15

So I would like to know the total score of each user.
But I don't know how to do this. Who can help me out?

Cheers,
Martin.





Re: [PHP] Count total

2001-08-19 Thread Chris Lambert

Assuming MySQL...


/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Martin Kampherbeek <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 5:34 AM
Subject: [PHP] Count total


Hi,

Who can help me with the following problem?
I have the tables score and totalscore.

Score:
id
userid
name
score

Totalscore:
userid
name
totalscore

In the table score one user can have mutiple scores. But in totalscore the
userid is unique. Now I want to count all the score's of a user en place
this at the same user in totalscore.

Example of score:
11Martin10
22John5
33Richard   12
41Martin  3
53Richard8
61Martin  7
72John15

So I would like to know the total score of each user.
But I don't know how to do this. Who can help me out?

Cheers,
Martin.





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




Re: [PHP] mysql , postgres

2001-08-19 Thread Tom Carter

What would you say the advantages were?

other than just the fact the the postgres implementation of sql is more
powerful (sub-selects etc).

I'ld be very interested to see some performance comparisions if anyone has
any
- Original Message -
From: "Chris Lambert" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 10:21 AM
Subject: Re: [PHP] mysql , postgres


> MySQL is easier to use and faster to develop with for 90% of web
> applications. Sure, PostgreSQL has some huge advantages, but not everyone
> needs the same thing.
>
> /* Chris Lambert, CTO - [EMAIL PROTECTED]
> WhiteCrown Networks - More Than White Hats
> Web Application Security - www.whitecrown.net
> */
>
> - Original Message -
> From: nafiseh saberi <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, August 19, 2001 4:24 AM
> Subject: [PHP] mysql , postgres
>
>
> |
> | hi.
> | why most of you , use mysql and not
> | postgres?
> | nafiseh.
> |
> | --
> | PHP General Mailing List (http://www.php.net/)
> | To unsubscribe, e-mail: [EMAIL PROTECTED]
> | For additional commands, e-mail: [EMAIL PROTECTED]
> | To contact the list administrators, e-mail: [EMAIL PROTECTED]
> |
> |
> |
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




Re: [PHP] mysql , postgres

2001-08-19 Thread Chris Lambert

Rules, triggers, subselects, built in transactions, etc.

I haven't used it myself, but it does have features which relieve a lot of
the client programming (PHP) required with MySQL.

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Tom Carter <[EMAIL PROTECTED]>
To: Chris Lambert <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 5:41 AM
Subject: Re: [PHP] mysql , postgres


| What would you say the advantages were?
|
| other than just the fact the the postgres implementation of sql is more
| powerful (sub-selects etc).
|
| I'ld be very interested to see some performance comparisions if anyone has
| any
| - Original Message -
| From: "Chris Lambert" <[EMAIL PROTECTED]>
| To: <[EMAIL PROTECTED]>
| Sent: Sunday, August 19, 2001 10:21 AM
| Subject: Re: [PHP] mysql , postgres
|
|
| > MySQL is easier to use and faster to develop with for 90% of web
| > applications. Sure, PostgreSQL has some huge advantages, but not
everyone
| > needs the same thing.
| >
| > /* Chris Lambert, CTO - [EMAIL PROTECTED]
| > WhiteCrown Networks - More Than White Hats
| > Web Application Security - www.whitecrown.net
| > */
| >
| > - Original Message -
| > From: nafiseh saberi <[EMAIL PROTECTED]>
| > To: <[EMAIL PROTECTED]>
| > Sent: Sunday, August 19, 2001 4:24 AM
| > Subject: [PHP] mysql , postgres
| >
| >
| > |
| > | hi.
| > | why most of you , use mysql and not
| > | postgres?
| > | nafiseh.
| > |
| > | --
| > | PHP General Mailing List (http://www.php.net/)
| > | To unsubscribe, e-mail: [EMAIL PROTECTED]
| > | For additional commands, e-mail: [EMAIL PROTECTED]
| > | To contact the list administrators, e-mail:
[EMAIL PROTECTED]
| > |
| > |
| > |
| >
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, e-mail: [EMAIL PROTECTED]
| > For additional commands, e-mail: [EMAIL PROTECTED]
| > To contact the list administrators, e-mail: [EMAIL PROTECTED]
| >
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


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




Re: [PHP] Count total

2001-08-19 Thread Rasmus Lerdorf

On Sun, 19 Aug 2001, Martin Kampherbeek wrote:

> Hi,
>
> Who can help me with the following problem?
> I have the tables score and totalscore.
>
> Score:
> id
> userid
> name
> score
>
> Totalscore:
> userid
> name
> totalscore
>
> In the table score one user can have mutiple scores. But in totalscore
> the userid is unique. Now I want to count all the score's of a user en
> place this at the same user in totalscore.
>
> Example of score:
> 11Martin10
> 22John5
> 33Richard   12
> 41Martin  3
> 53Richard8
> 61Martin  7
> 72John15
>
> So I would like to know the total score of each user.
> But I don't know how to do this. Who can help me out?

insert into totalscores (userid,name,totalscore) select userid, name, sum(score) as 
totalscore from scores group by userid;

-Rasmus


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




Re: [PHP] mysql , postgres

2001-08-19 Thread Michael

Chris Lambert wrote:
> 
> MySQL is easier to use and faster to develop with for 90% of web
> applications. Sure, PostgreSQL has some huge advantages, but not everyone
> needs the same thing.

easier to use ? I'm not sure why anyone would say that
faster to develop ? nope - I find postgresql quicker to develop with, I
can use triggers to cut out a whole heap of extra php code.
MYsql lacks subselects which forces you to do extra code, it lacks true
foreign keys which means you need to add extra code to check data
integrity.

People use MYSql because it's so widely available, just like people use
Windows.


> 
> /* Chris Lambert, CTO - [EMAIL PROTECTED]
> WhiteCrown Networks - More Than White Hats
> Web Application Security - www.whitecrown.net
> */
> 

> |
> |

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




Re: [PHP] mysql , postgres

2001-08-19 Thread Michael

Tom Carter wrote:
> 
> What would you say the advantages were?
> 
Well just my opinion but I think that Postgresql development is
advancing quicker. With Red Hat joining in development and no infighting
bewteen Postgresql developers  things are looking good for the future.

> other than just the fact the the postgres implementation of sql is more
> powerful (sub-selects etc).

Foreign keys, triggers both make life a lot easier.
Also once your used to Postgresql, moving onto Sybase, Interbase etc
isn't near as hard as making the jump from MYsql.

> 
> I'ld be very interested to see some performance comparisions if anyone has
> any

Dig around greatbridge.org and you might find some.

> - Original Message -
> From: "Chris Lambert" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, August 19, 2001 10:21 AM
> Subject: Re: [PHP] mysql , postgres
> 
> > MySQL is easier to use and faster to develop with for 90% of web
> > applications. Sure, PostgreSQL has some huge advantages, but not everyone
> > needs the same thing.
> >
> > /* Chris Lambert, CTO - [EMAIL PROTECTED]
> > WhiteCrown Networks - More Than White Hats
> > Web Application Security - www.whitecrown.net
> > */
> >
> > - Original Message -
> > From: nafiseh saberi <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Sunday, August 19, 2001 4:24 AM
> > Subject: [PHP] mysql , postgres
> >
> >
> > |
> > | hi.
> > | why most of you , use mysql and not
> > | postgres?
> > | nafiseh.
> > |
> > | --
> > | PHP General Mailing List (http://www.php.net/)
> > | To unsubscribe, e-mail: [EMAIL PROTECTED]
> > | For additional commands, e-mail: [EMAIL PROTECTED]
> > | To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > |
> > |
> > |
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >

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




Re: [PHP] mysql , postgres

2001-08-19 Thread Tom Carter



> Chris Lambert wrote:
> >
> > MySQL is easier to use and faster to develop with for 90% of web
> > applications. Sure, PostgreSQL has some huge advantages, but not
everyone
> > needs the same thing.
>
> easier to use ? I'm not sure why anyone would say that
> faster to develop ? nope - I find postgresql quicker to develop with, I
> can use triggers to cut out a whole heap of extra php code.
> MYsql lacks subselects which forces you to do extra code, it lacks true
> foreign keys which means you need to add extra code to check data
> integrity.
>
> People use MYSql because it's so widely available, just like people use
> Windows.

I would definately agree with the points about psotgresql having better
functionallity, but it doesn't solely come down to availablility.

MySQL is a simpler RDBMS.. this doesn't mean it is strictly "worse" than
postgresql. In comes to one of those fundamental questions in IT... best
tool for the job. What MySQl is good at is handling small (in both byte and
row sense) tables which are frequently accessed, eg user authenitcatino. At
the other extreme are the big boys of DB2, Oracle etc which can handle an
awful lot and cope which much more complex structures and heavy usage.
postgresql, IMHO, is a few steps from the MySQL extreme towards DB2. What I
basically mean is that postgre has some features and functionallity which
make it more suited to some tasks, and mysql has a place too.



>
>
> >
> > /* Chris Lambert, CTO - [EMAIL PROTECTED]
> > WhiteCrown Networks - More Than White Hats
> > Web Application Security - www.whitecrown.net
> > */
> >
>
> > |
> > |
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




Re: [PHP] mysql , postgres

2001-08-19 Thread indrek siitan

Hi,

> Well just my opinion but I think that Postgresql development is
> advancing quicker. With Red Hat joining in development and no
> infighting bewteen Postgresql developers  things are looking
> good for the future.

just to clear one issue - there has never been a "fight between mysql
developers".

the thing you're probably referring to above is the MySQL-vs-NuSphere fight.
NuSphere was to add their Gemini table handler (MySQL has an abstraction table
handler layer, so you can add many different table handlers) to MySQL. it has
not and won't affect the general development of MySQL.


Rgds,
Indrek

--
For technical support contracts, goto https://order.mysql.com/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Indrek Siitan <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, The Web Guru
/_/  /_/\_, /___/\___\_\___/   Tallinn, Estonia
   <___/   www.mysql.com


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




[PHP] coding standards

2001-08-19 Thread Michael

Ive read through the PEAR coding standards but was wondering about a few
things not talked about in them -

- Is declaring all variables a good idea - so theres no unassigned
variables hanging around ? (no warnings produced when error reporting
set to E_ALL)
- Naming of include files - .inc or .php ?
- naming of class files .inc or .php ?

I know these have no big effect on the actual scripts themselves - but
was wondering what people  consider "good practice" to be.

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




[PHP] Smarty: Assigning custom function section variable

2001-08-19 Thread Alexander Skwar

Hi!

I'm having some problem assigning a custom function ({math}) a value of
a {section} block.
I've got a section where I want to do some easy math.  But somehow I'm
stuck

Here's my template:

Section Test

{section name=people loop=$FirstName}
  {$FirstName[people]} {$LastName[people]}
  {math equation="x + y" x="{$FirstName[people]}" y="{$LastName[people]}"}
{/section}



The PHP code:

assign("FirstName", $y);
$smarty->assign("LastName", $x);

$smarty->display("test.tpl");
?>

When I run this, I get the following errormessage in my browser:


Parse error: parse error, expecting `'}'' in
/home/askwar/public_html/olg/html/templates_c/test.tpl.php on line 65

Line 65:

  "x + y",'x' =>
 "{$FirstName[people]"), $this); if($this->_extract) {
 extract($this->_tpl_vars); $this->_extract=false; } ?>" y="_tpl_vars['LastName'][$this->_sections['people']['properties']['index']]
 ;?>


Also removing the { and } at the x= and y= section in my template
doesn't work.  The section now looks like this:

{section name=people loop=$FirstName}
  {%people.rownum%} {$FirstName[people]} {$LastName[people]} {math
  equation="x + y" x="$FirstName[people]" y="$LastName[people]"}
{/section}


Now I get 5 lines in my browser, but also a different error message:

 1 9 1
Warning: Smarty error: math: parameter x is empty in
/home/askwar/public_html/olg/html/OliG-System/smarty/Smarty.class.php on
line 1090


The first "1 9 1" is correct.  It's the row number and the values of x
and y.

How can I do this?

Thanks a lot!

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 day 12 hours 10 minutes

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




Re: [PHP] mysql , postgres

2001-08-19 Thread Michael

Indrek Siitan wrote:
> 
> Hi,
> 
> > Well just my opinion but I think that Postgresql development is
> > advancing quicker. With Red Hat joining in development and no
> > infighting bewteen Postgresql developers  things are looking
> > good for the future.
> 
> just to clear one issue - there has never been a "fight between mysql
> developers".
> 
> the thing you're probably referring to above is the MySQL-vs-NuSphere fight.
> NuSphere was to add their Gemini table handler (MySQL has an abstraction table
> handler layer, so you can add many different table handlers) to MySQL. it has
> not and won't affect the general development of MySQL.
> 
> Rgds,
> Indrek
> 
fair enough - slip of the tongue there 

but it does highlight the differences in in development style between
MYsql and Postgresql.



> For technical support contracts, goto https://order.mysql.com/
>__  ___ ___   __
>   /  |/  /_ __/ __/ __ \/ /Indrek Siitan <[EMAIL PROTECTED]>
>  / /|_/ / // /\ \/ /_/ / /__   MySQL AB, The Web Guru
> /_/  /_/\_, /___/\___\_\___/   Tallinn, Estonia
><___/   www.mysql.com

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




[PHP] Re: transaction

2001-08-19 Thread Michael

Nafiseh Saberi wrote:
> 
> hi.
> in large database with php,postgres
> and when in each time come many request ,
> how do we implement transactions??

> nafiseh.

If you are wanting to run several queries in the one script though the
one transaction -
you'll need to send a begin(as a query) and execute it - then to the
same connection send all your other queries as normal, and follow it up
with a commit.

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




[PHP] error in source !

2001-08-19 Thread nafiseh saberi


hi.

I write it with php to relationship with databasein database server
(with postgres).
to update on field of one special row.

 $up = pg_exec($conn,"update personel set exit_m ='now' where  
name=  '$ID' and date='now' ");

what is the error in it??
thanks.



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




[PHP] MySQL substrings?

2001-08-19 Thread Seb Frost

This is thew sort of thing I want:

SELECT * FROM table ORDER BY substr(field,5,6)

but I don't know the correct function, if there is one, or how to implement
it.

cheers,

- seb

-Original Message-
From: Michael [mailto:[EMAIL PROTECTED]]
Sent: 19 August 2001 12:51
To: [EMAIL PROTECTED]
Subject: [PHP] Re: transaction


Nafiseh Saberi wrote:
>
> hi.
> in large database with php,postgres
> and when in each time come many request ,
> how do we implement transactions??

> nafiseh.

If you are wanting to run several queries in the one script though the
one transaction -
you'll need to send a begin(as a query) and execute it - then to the
same connection send all your other queries as normal, and follow it up
with a commit.

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


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




[PHP] Re: error in source !

2001-08-19 Thread Hugh Bothwell


"Nafiseh Saberi" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I write it with php to relationship with databasein database server
> (with postgres).
> to update on field of one special row.
>
>  $up = pg_exec($conn,"update personel set exit_m ='now' where
> name=  '$ID' and date='now' ");

Isn't 'now' as function, ie should be 'now()'?



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




[PHP] error in source !

2001-08-19 Thread nafiseh saberi


my problem solved,
because of not match in {}.

thanks.

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




[PHP] problems with a netscape post

2001-08-19 Thread P

Hi,

I am trying to post some form data to a php page that then updates a
mysql database and echos back to the browser that the data has been
inputted. Here is the general form of my post;-



.. form widgets here .




this works perfectly with IE and opera, but with netscape 4.* it
either takes ages for the event to transpire or times out.  I am not
trying to post any files ect, just text field data, 1k max, anyone
have any ideas what is going wrong?

thanks


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




Re: [PHP] MySQL substrings?

2001-08-19 Thread Tom Carter

You can achieve the same effect by using left and right
- Original Message -
From: "Seb Frost" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 3:12 PM
Subject: [PHP] MySQL substrings?


> This is thew sort of thing I want:
>
> SELECT * FROM table ORDER BY substr(field,5,6)
>
> but I don't know the correct function, if there is one, or how to
implement
> it.
>
> cheers,
>
> - seb
>
> -Original Message-
> From: Michael [mailto:[EMAIL PROTECTED]]
> Sent: 19 August 2001 12:51
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: transaction
>
>
> Nafiseh Saberi wrote:
> >
> > hi.
> > in large database with php,postgres
> > and when in each time come many request ,
> > how do we implement transactions??
>
> > nafiseh.
>
> If you are wanting to run several queries in the one script though the
> one transaction -
> you'll need to send a begin(as a query) and execute it - then to the
> same connection send all your other queries as normal, and follow it up
> with a commit.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




[PHP] PHP based authentification -----------

2001-08-19 Thread Alex Sofronie

Hi all!

How can I "logout" from a PHP based auth (with PHP_AUTH_USER and PHP_AUTH_PW
and appropriate headers sent at the beginning)?
It seems like unset($PHP_AUTH_USER) does not wotk in this case...

Any help would be appreciated!

Alex Sofronie
[EMAIL PROTECTED]



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




[PHP] sendmail

2001-08-19 Thread BRACK

Hi,

I'm on virtual hosting that lets me configure anything with .htaccess 
file. I was recomended by provider to specify location of sendmail in 
case I want to use php mail() function I know that I may do it in 
.htaccess file by adding php_value sendmail_path 
/usr/sbin/sendmail The qwestion is can I do anything else but 
correcting the path in .htaccess, this is the last thing I want to do.

Youri
<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org

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




[PHP] Errors

2001-08-19 Thread BRACK

Hi

I'm getting strange errors if I add 
"LoadModule php4_module ../php/sapi/php4apache.dll" to http.conf 
If I don't load it everything is working with php.exe without any errors but as I 
load it as a modul I get for example -
Warning: Undefined variable: page in d:\abria 
sql\apache\htdocs\inc\page.inc on line 2
 here is the page.inc file:


What is wrong? I need php as a modul but what do I do 
wrong, I did everything according to install.txt in php 
directory.

Thank you

Youri

<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org

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




Re: [PHP] MySQL substrings?

2001-08-19 Thread Chris Lambert

There is a SUBSTRING() function, its just hard to find with their search
system.

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Tom Carter <[EMAIL PROTECTED]>
To: Seb Frost <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 10:32 AM
Subject: Re: [PHP] MySQL substrings?


| You can achieve the same effect by using left and right
| - Original Message -
| From: "Seb Frost" <[EMAIL PROTECTED]>
| To: <[EMAIL PROTECTED]>
| Sent: Sunday, August 19, 2001 3:12 PM
| Subject: [PHP] MySQL substrings?
|
|
| > This is thew sort of thing I want:
| >
| > SELECT * FROM table ORDER BY substr(field,5,6)
| >
| > but I don't know the correct function, if there is one, or how to
| implement
| > it.
| >
| > cheers,
| >
| > - seb
| >
| > -Original Message-
| > From: Michael [mailto:[EMAIL PROTECTED]]
| > Sent: 19 August 2001 12:51
| > To: [EMAIL PROTECTED]
| > Subject: [PHP] Re: transaction
| >
| >
| > Nafiseh Saberi wrote:
| > >
| > > hi.
| > > in large database with php,postgres
| > > and when in each time come many request ,
| > > how do we implement transactions??
| >
| > > nafiseh.
| >
| > If you are wanting to run several queries in the one script though the
| > one transaction -
| > you'll need to send a begin(as a query) and execute it - then to the
| > same connection send all your other queries as normal, and follow it up
| > with a commit.
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, e-mail: [EMAIL PROTECTED]
| > For additional commands, e-mail: [EMAIL PROTECTED]
| > To contact the list administrators, e-mail: [EMAIL PROTECTED]
| >
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, e-mail: [EMAIL PROTECTED]
| > For additional commands, e-mail: [EMAIL PROTECTED]
| > To contact the list administrators, e-mail: [EMAIL PROTECTED]
| >
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


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




[PHP] Re: Browser Detection & Redirection -- PHP or Apache ???

2001-08-19 Thread Elias Santiago

Why not use something easier like phpSniff.

http://phpsniff.sourceforge.net/

You don't need a browscap.ini or troubling around with get_browser();

Elias Santiago

"Christopher Raymond" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> PHP Folks:
>
> Does PHP provide some mechanism for browser detection & redirection or is
> this something that Apache Directives can handle?
>
> For example: I don't want users with browsers less than 4.0 to actually
load
> a page on our site. Instead, I want them redirected to a page that let's
> them know their browser is in-compatible.
>
> I know this is something JavaScript can do, but again that relies on the
> browser.
>
>
> Thanks for any help,
>
> Christopher Raymond
>



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




Re: [PHP] MySQL substrings?

2001-08-19 Thread Tom Carter

very hard obviously.. I've looked quite a bit before to no avail! I tried
guessing it, obviously stupidity prevailed

(note to self.. go back and use substring function instead)
- Original Message -
From: "Chris Lambert" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 3:48 PM
Subject: Re: [PHP] MySQL substrings?


> There is a SUBSTRING() function, its just hard to find with their search
> system.
>
> /* Chris Lambert, CTO - [EMAIL PROTECTED]
> WhiteCrown Networks - More Than White Hats
> Web Application Security - www.whitecrown.net
> */
>
> - Original Message -
> From: Tom Carter <[EMAIL PROTECTED]>
> To: Seb Frost <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Sunday, August 19, 2001 10:32 AM
> Subject: Re: [PHP] MySQL substrings?
>
>
> | You can achieve the same effect by using left and right
> | - Original Message -
> | From: "Seb Frost" <[EMAIL PROTECTED]>
> | To: <[EMAIL PROTECTED]>
> | Sent: Sunday, August 19, 2001 3:12 PM
> | Subject: [PHP] MySQL substrings?
> |
> |
> | > This is thew sort of thing I want:
> | >
> | > SELECT * FROM table ORDER BY substr(field,5,6)
> | >
> | > but I don't know the correct function, if there is one, or how to
> | implement
> | > it.
> | >
> | > cheers,
> | >
> | > - seb
> | >
> | > -Original Message-
> | > From: Michael [mailto:[EMAIL PROTECTED]]
> | > Sent: 19 August 2001 12:51
> | > To: [EMAIL PROTECTED]
> | > Subject: [PHP] Re: transaction
> | >
> | >
> | > Nafiseh Saberi wrote:
> | > >
> | > > hi.
> | > > in large database with php,postgres
> | > > and when in each time come many request ,
> | > > how do we implement transactions??
> | >
> | > > nafiseh.
> | >
> | > If you are wanting to run several queries in the one script though the
> | > one transaction -
> | > you'll need to send a begin(as a query) and execute it - then to the
> | > same connection send all your other queries as normal, and follow it
up
> | > with a commit.
> | >
> | > --
> | > PHP General Mailing List (http://www.php.net/)
> | > To unsubscribe, e-mail: [EMAIL PROTECTED]
> | > For additional commands, e-mail: [EMAIL PROTECTED]
> | > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> | >
> | >
> | > --
> | > PHP General Mailing List (http://www.php.net/)
> | > To unsubscribe, e-mail: [EMAIL PROTECTED]
> | > For additional commands, e-mail: [EMAIL PROTECTED]
> | > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> | >
> |
> |
> | --
> | PHP General Mailing List (http://www.php.net/)
> | To unsubscribe, e-mail: [EMAIL PROTECTED]
> | For additional commands, e-mail: [EMAIL PROTECTED]
> | To contact the list administrators, e-mail: [EMAIL PROTECTED]
> |
> |
> |
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




RE: [PHP] MySQL substrings?

2001-08-19 Thread Seb Frost

This doesn't work:

$result = mysql_query("SELECT * FROM $table ORDER BY SUBSTRING(date,5,2)")

Any idea why?

- seb

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




RE: [PHP] class variables and methods

2001-08-19 Thread Joe Sheble \(Wizaerd\)


But when designing classes, isn't it normal to have private and public
variables or properties.  Granted my OOP experience is very limited, having
access to OOP development in CA-Visual Objects, Clipper, VB, and ASP.  But
it was normal to have a series of public properties one could access
directly and then properties that could only be access by the class itself.
Of course in VB and ASP these were defined with Get, Let and Set methods,
but you could still access them directly.  You could also design properties
that were read only as well.  Perhaps this is because of operator
overloading??

> -Original Message-
> From: Tom Carter [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 19, 2001 2:19 AM
> To: Andrew Libby; Joe Sheble (Wizaerd)
> Cc: General PHP List
> Subject: Re: [PHP] class variables and methods
>
>
> There was a long discussion on this in a java forum I am part of, the
> product of which was basically this...
>
> 1. All variables in a class are best left to be private (not sure PHP has
> this, but the programmer can work the principle in mind.. that is only the
> class can access them).
> 2. Generic variable access/store methods should be avoided - the principle
> is that the internal variable can change name etc. without the external
> interface having to worry about it.
> 3. Method to set/fetch each variable - it may seem a counter intuitive way
> of doing it, especially when it is possible to do something
> "nice" like the
> set method below. This seems a very "un-web" way.. and this is where a
> difference comes in. Web is not inherently OO, and a lot of the
> practices of
> web programmers are at conflict with more "traditional" apps programmers.
> Web tends to go for speed and simplicity, rather than good design etc.
> 4. Some situations could theoretically arise where it is
> necessary to set an
> unknown amount of variables within a class, however it would be far more
> sensible to put these into an array.
>
> In summary, in good OOP you should have a method for every
> get/set operation
> on variables that is required, using arrays as appropiate.
>
> Going back to the original point on whether or not to access the variable
> directly or build a set function in, they are both as bad as each other,
> just about. They both access variables directly and require the outside
> program to have knowledge of variable names etc. and it doesn't allow for
> checking for "correct" values being set ( a useful thin with the above
> method)
>
> Hope this helps, let me know if I can provide any more advice.
>
> Tom
>
> - Original Message -
> From: "Andrew Libby" <[EMAIL PROTECTED]>
> To: "Joe Sheble (Wizaerd)" <[EMAIL PROTECTED]>
> Cc: "General PHP List" <[EMAIL PROTECTED]>
> Sent: Sunday, August 19, 2001 3:34 AM
> Subject: Re: [PHP] class variables and methods
>
>
> > Joe,
> > There are varying opinions on this issue.  The argument for
> > methods is that it hides the internal structure of your class.  This
> > is always a good thing.  This means that the internals of the class
> > can be changed, but the user interface (the user is the programmer here)
> > does not change.  So this alternative implementation of someclass
> >
> >
> > class someclass
>
> > var $data = false;
> >
> > function set($key,$val) {
> > $this->data[$key] = $val;
> > }
> > }
> >
> > is no different the the calling code.  In general, I tend to have an
> > accessor/mutator method for each 'property' that I would like to
> > provide access to.  I'd have a method for each $key that I want to
> > support (this may not apply in your case).
> >
> > class someclass
>
> > var $name = false;
> > var $age  = false;
> >
> > function name()
>
> > if(func_num_args()) $this->name = func_get_arg(0);
> > return $this->name;
> > }
> >
> > function age()
>
> > if(func_num_args()) $this->age= func_get_arg(0);
> > return $this->age;
> > }
> > }
> >
> > Now, this gets a big annoying to code since the lions share of my
> > classes have the name method implementations.  I've been hunting
> > for a way to create methods dynamically, but I've only found one.
> > To create class definitions on the fly and eval() them.  This
> > works great when you've got a huge number of properties
> > (class/instance vars).  I'll construct a static method on the
> > class that processes examines the class vars (get_class_vars())
> > and defines a class extending my implementation.   The
> > sub class has the methods implemented for accessing/mutating
> > the properties I'd like to have methods for.  If anyone knows
> > of a means to do this to an existing class (say using create_function()
> > or something), I'd love to hear about it.
> >
> > Andy
> >
> >
> > On Sat, Aug 18, 2001 at 07:09:08PM -0700, Joe Sheble (Wizaerd) wrote:
> > > I've been doing some reading up on OOP in PHP, and looking at some of
> the
> > > classes available on the web, and I've got what is probably

[PHP] virtual() ignoring str_replace()

2001-08-19 Thread Charlie Romero

I'm trying to include a .cgi using the virtual() function and then do a
string replace on a string w/in the included page.  The virtual seems to
ignore the str_replace it just prints the virtual include w/out replacing
the word "window" w/ the word "DOG" in my example. What am I doing wrong?




TIA,

Charlie


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




Re: [PHP] class variables and methods

2001-08-19 Thread Tom Carter

There is a distinct chance of many difference schools of thought... my
background is Java (mostly at IBM.. so of course could be very different)..
but all the java gurus I've known have worked on the principle private
variable and public methods.. declaring all variables (except constants..
php doesn't really have a comparably concept) as private and always using
methods.

I would be very interested to hear others opinion on this...


>
> But when designing classes, isn't it normal to have private and public
> variables or properties.  Granted my OOP experience is very limited,
having
> access to OOP development in CA-Visual Objects, Clipper, VB, and ASP.  But
> it was normal to have a series of public properties one could access
> directly and then properties that could only be access by the class
itself.
> Of course in VB and ASP these were defined with Get, Let and Set methods,
> but you could still access them directly.  You could also design
properties
> that were read only as well.  Perhaps this is because of operator
> overloading??
>
> > -Original Message-
> > From: Tom Carter [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, August 19, 2001 2:19 AM
> > To: Andrew Libby; Joe Sheble (Wizaerd)
> > Cc: General PHP List
> > Subject: Re: [PHP] class variables and methods
> >
> >
> > There was a long discussion on this in a java forum I am part of, the
> > product of which was basically this...
> >
> > 1. All variables in a class are best left to be private (not sure PHP
has
> > this, but the programmer can work the principle in mind.. that is only
the
> > class can access them).
> > 2. Generic variable access/store methods should be avoided - the
principle
> > is that the internal variable can change name etc. without the external
> > interface having to worry about it.
> > 3. Method to set/fetch each variable - it may seem a counter intuitive
way
> > of doing it, especially when it is possible to do something
> > "nice" like the
> > set method below. This seems a very "un-web" way.. and this is where a
> > difference comes in. Web is not inherently OO, and a lot of the
> > practices of
> > web programmers are at conflict with more "traditional" apps
programmers.
> > Web tends to go for speed and simplicity, rather than good design etc.
> > 4. Some situations could theoretically arise where it is
> > necessary to set an
> > unknown amount of variables within a class, however it would be far more
> > sensible to put these into an array.
> >
> > In summary, in good OOP you should have a method for every
> > get/set operation
> > on variables that is required, using arrays as appropiate.
> >
> > Going back to the original point on whether or not to access the
variable
> > directly or build a set function in, they are both as bad as each other,
> > just about. They both access variables directly and require the outside
> > program to have knowledge of variable names etc. and it doesn't allow
for
> > checking for "correct" values being set ( a useful thin with the above
> > method)
> >
> > Hope this helps, let me know if I can provide any more advice.
> >
> > Tom
> >
> > - Original Message -
> > From: "Andrew Libby" <[EMAIL PROTECTED]>
> > To: "Joe Sheble (Wizaerd)" <[EMAIL PROTECTED]>
> > Cc: "General PHP List" <[EMAIL PROTECTED]>
> > Sent: Sunday, August 19, 2001 3:34 AM
> > Subject: Re: [PHP] class variables and methods
> >
> >
> > > Joe,
> > > There are varying opinions on this issue.  The argument for
> > > methods is that it hides the internal structure of your class.  This
> > > is always a good thing.  This means that the internals of the class
> > > can be changed, but the user interface (the user is the programmer
here)
> > > does not change.  So this alternative implementation of someclass
> > >
> > >
> > > class someclass
> >
> > > var $data = false;
> > >
> > > function set($key,$val) {
> > > $this->data[$key] = $val;
> > > }
> > > }
> > >
> > > is no different the the calling code.  In general, I tend to have an
> > > accessor/mutator method for each 'property' that I would like to
> > > provide access to.  I'd have a method for each $key that I want to
> > > support (this may not apply in your case).
> > >
> > > class someclass
> >
> > > var $name = false;
> > > var $age  = false;
> > >
> > > function name()
> >
> > > if(func_num_args()) $this->name = func_get_arg(0);
> > > return $this->name;
> > > }
> > >
> > > function age()
> >
> > > if(func_num_args()) $this->age= func_get_arg(0);
> > > return $this->age;
> > > }
> > > }
> > >
> > > Now, this gets a big annoying to code since the lions share of my
> > > classes have the name method implementations.  I've been hunting
> > > for a way to create methods dynamically, but I've only found one.
> > > To create class definitions on the fly and eval() them.  This
> > > works great when you've got a huge number of properties
> > > (class/instance vars).  I'l

RE: [PHP] problems with a netscape post

2001-08-19 Thread Quentin Gillet

I have the same problem, I'm curious to hear what people say about this

-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Envoyé : dimanche 19 août 2001 16:34
À : [EMAIL PROTECTED]
Objet : [PHP] problems with a netscape post


Hi,

I am trying to post some form data to a php page that then updates a
mysql database and echos back to the browser that the data has been
inputted. Here is the general form of my post;-



.. form widgets here .




this works perfectly with IE and opera, but with netscape 4.* it
either takes ages for the event to transpire or times out.  I am not
trying to post any files ect, just text field data, 1k max, anyone
have any ideas what is going wrong?

thanks


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



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




[PHP] More SNMP Functions for PHPv4

2001-08-19 Thread Robert Schultz

A while ago, Vilius Benetis, an engineer from Lithuania created some great
new SNMP functions for PHP 3 (snmp_getnext(), etc.)

Well I've modified the code so that it will compile under PHP v4 now. (This
is a replacement to the PHP source code, and not actually PHP Code)

It can be found at: http://www.ncinter.net/~bert/php-snmp-v4.tar.gz

Enjoy.

Robert Schultz - [EMAIL PROTECTED]




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




[PHP] --enable-memory-limit - What does it do?

2001-08-19 Thread Kai Schaetzl

Well, there's no explanation for it in the manual and I didn't find 
any by searching all relevant archives with deja. So, what does it 
EXACTLY do when I compile it in and are there configuration options 
for it? (f.i. the amount of memory to limit to ;-)


Kai

--

Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com
IE-Center: http://ie5.de & http://msie.winware.org
ClubWin - Help for Windows Users: http://www.clubwin.com




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




Re: [PHP] problems with a netscape post

2001-08-19 Thread Steve Lawson

Try giving the form a name?

I normally use something like...



Any it works in NS 4+

SL

- Original Message -
From: "Quentin Gillet" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 10:06 AM
Subject: RE: [PHP] problems with a netscape post


> I have the same problem, I'm curious to hear what people say about
this
>
> -Message d'origine-
> De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Envoyé : dimanche 19 août 2001 16:34
> À : [EMAIL PROTECTED]
> Objet : [PHP] problems with a netscape post
>
>
> Hi,
>
> I am trying to post some form data to a php page that then updates a
> mysql database and echos back to the browser that the data has been
> inputted. Here is the general form of my post;-
>
> 
>
> .. form widgets here .
>
> 
> 
>
> this works perfectly with IE and opera, but with netscape 4.* it
> either takes ages for the event to transpire or times out.  I am not
> trying to post any files ect, just text field data, 1k max, anyone
> have any ideas what is going wrong?
>
> thanks
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




Re: [PHP] MySQL substrings?

2001-08-19 Thread Chris Lambert

It'd help if you have us the mysql_error() returned.

Try the following:

SELECT *, substring_date AS SUBSTRING(date,5,2) FROM $table ORDER BY
substring_date

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Seb Frost <[EMAIL PROTECTED]>
To: Tom Carter <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 11:19 AM
Subject: RE: [PHP] MySQL substrings?


| This doesn't work:
|
| $result = mysql_query("SELECT * FROM $table ORDER BY SUBSTRING(date,5,2)")
|
| Any idea why?
|
| - seb
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


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




[PHP] HTTPS oddity

2001-08-19 Thread Nigel Jewell

Dear all,

I have a SSL server set up and I check in PHP that its running over SSL by
doing:

if ($HTTPS) {
...
}

This has worked for ages - but sometime last night the behaviour of my/our
server changed and now over an non-SSL connection, $HTTPS = ON and over a
SSL connection $HTTPS = on (note the change in case).  This is odd - and I
can't find the source.

Unfortunately I'm not the only one with admin access to the server - so
someone may have changed something :(.

Anyone got any ideas?  Where to start looking?

Thanks,

Nige.

--
URL: http://www.grufty.co.uk


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




[PHP] Function to Build Trees

2001-08-19 Thread Sondra Russell

Hello everyone,

I've been tearing my hair out trying to write a function in PHP that 
will accomplish the following:

Given a multidimensional array with words as keys, I want to match 
the values of each array with the keys of the array and build a new 
array that reflects these relationships as a sort of tree.  So, in 
the list below, "fruit", "apples", "oranges", "red" are the keys and 
in the "fruit" array are the values "apples" and "oranges", so I want 
the function to create a new array that looks like:

ORIGINAL ARRAY:
$array['fruits'] = array("apples","oranges","pears");
$array['apples'] = array("red","granny smith");
$array['oranges'] = array('mandarin');
$array['red'] = array("big red","small red");

NEW ARRAY:
$array['fruits'] = array(apples,oranges,pears);
$array['fruits']['apples'] = array("red","granny smith");
$array['fruits']['oranges'] = array('mandarin');

And then I want it further to figure out that "red", now in the array 
found at: $array['fruits']['apples'] matches a key in the original 
array so the final result looks like:

FINAL ARRAY:
$array['fruits'] = array(apples,oranges,pears);
$array['fruits']['oranges'] = array('mandarin');
$array['fruits']['apples'] = array("red","granny smith");
$array['fruits']['apples']['red'] = array("big red","small red");

So, you see how it builds a little tree, right?

AND, I'd like this function to be able to handle any number (probably 
less that 30, but whatever) of initial array elements in an 
unpredictable order and the final tree could have up to five or six 
levels.  You know?

Is this impossible, or am I just going about the end result wrong?? 
It seemed like such a simple thing three days ago, but now I am about 
to cry uncle.

Anyway, please write if you have any thoughts.

Best,
Sondra Russell



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




[PHP] Sessions in pop-up windows

2001-08-19 Thread Chris Cameron

I'm having some issues passing a session to a pop-up window.

The pop-up window is you average DreamWeaver popup:
Link

When you click on the link, the session doesn't get passed. I have 
trans-sid enabled.

Any ideas on how I could go about passing my sid?

Thanks,
Chris

-- 
Chris Cameron
System Administrator
UpNIX Internet Services
http://www.upnix.com/


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




Re: [PHP] Errors

2001-08-19 Thread Steve Edberg

Well, since you're getting a PHP error, PHP is obviously parsing the 
page. My guess is that your error reporting (in php.ini, httpd.conf 
or .htaccess) is set very high, so that uninitialized variables 
generate a warning. You could either (1) initialize $page at the top 
of your program:

$page = false;

or (2) lower the warning level:

http://www.php.net/manual/en/features.error-handling.php
http://www.php.net/manual/en/configuration.php
http://www.php.net/manual/en/ref.errorfunc.php

If $page is coming from somewhere else (eg; GET/POST parameters) then 
you can test for its existence like so:

if (!isset($page)) { $page = false; }

or $page = 0...whatever's appropriate.

-steve


At 4:45 PM +0200 8/19/01, BRACK wrote:
>Hi
>
>I'm getting strange errors if I add
>"LoadModule php4_module ../php/sapi/php4apache.dll" to http.conf
>If I don't load it everything is working with php.exe without any 
>errors but as I
>load it as a modul I get for example -
>Warning: Undefined variable: page in d:\abria
>sql\apache\htdocs\inc\page.inc on line 2
>  here is the page.inc file:
>if (!$page):
> $page = 1;
>endif;
>$limit = ($page * 10) - 10;
>?>
>
>What is wrong? I need php as a modul but what do I do
>wrong, I did everything according to install.txt in php
>directory.
>
>Thank you
>
>Youri
>
><>< <>< <>< <>< God is our provider ><> ><> ><> ><>
>http://www.body-builders.org
>

-- 
+ Open source questions? +
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+--- http://pgfsun.ucdavis.edu/open-source-tools.html ---+

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




[PHP] Re: virtual() ignoring str_replace()

2001-08-19 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Charlie Romero) wrote:

> it just prints the virtual include w/out replacing
> the word "window" w/ the word "DOG" in my example. What am I doing wrong?
> 
> $results = virtual("/cgi-bin/search.cgi?q=hello&m=world");
> print str_replace("window", "DOG", $results);

str_replace() is case-sensitive.  If $results is returning a string like 
"Windows are nice" (it would help to see the actual string next time...hint 
hint), it won't match "window".

-- 
CC

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




[PHP] SV: Weird problems passing variables

2001-08-19 Thread JOHANSSON JÖRGEN

Thanks dude, that looks way nicer. I did however get it working by changing
the casting (tried to post my correction, but hit the wrong button), the
corrected, and after Lynch's enlightening me on mktime´s behaviour even butt
uglier code can be found below. (Change in arguments is solely due to a
redesign of the form).

On a mere philosophical level I'd like to know how the original code could
work on IE5, it's also got a dead obvious bug in the zeroPadDate() function
(didn't set $mstr or $dstr when month>=10 or day>=10).  And no, it wasn't
due to using different arguments to the script on the different browsers...

Anyway, thanks! //Claes

/*
 Function getDates(from, to) takes strings containing dates in the form
"-MM-DD"
and returns an array containing the dates between "from" and "to"
inclusive
*/

function getDates($f_year, $f_month, $f_date, $t_year, $t_month, $t_date) {
 $year=(int) $f_year;
 $month=(int) $f_month;
 $date=(int) $f_date;
 $to=zeroPadDate((int) $t_year, (int) $t_month,(int) $t_date);
 $datearray[0]=zeroPadDate($year, $month, $date);
 $current=$datearray[0];
 while($current!=$to) {
  $date=$date+1;
  if(checkdate($month, $date, $year)) {
   $current=zeroPadDate($year, $month, $date);
   $datearray[]=$current;
  } else {
   $month=$month+1;
   $date=1;
   if (checkdate($month, $date, $year)) {
$current=zeroPadDate($year, $month, $date);
$datearray[]=$current;
   } else {
$year=$year+1;
$month=1;
$current=zeroPadDate($year, $month, $date);
$datearray[]=$current;
   }
  }
 }
 return $datearray;
}

/* Accessory function to getDates above.  */

function zeroPadDate($year, $month, $date) {
 if ($month<10) {
  $mstr="0$month";
 } else {
  $mstr=$month;
 }
 if ($date<10) {
  $dstr="0$date";
 } else {
  $dstr=$date;
 }
 return "$year-$mstr-$dstr";
}




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




[PHP] Re: virtual() ignoring str_replace()

2001-08-19 Thread jimw

Charlie Romero <[EMAIL PROTECTED]> wrote:
> $results = virtual("/cgi-bin/search.cgi?q=hello&m=world");

virtual doesn't return the content of the subrequest, it sends it to
the browser.

you need to use something like popen() to do what you're trying
to do.

jim

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




RE: [PHP] Sessions in pop-up windows

2001-08-19 Thread Quentin Gillet

be sure
session.auto_start=1
and
session.use_trans_sid=1
and that
session.gc_maxlifetime has a reasonable value

-Message d'origine-
De : Chris Cameron [mailto:[EMAIL PROTECTED]]
Envoye : dimanche 19 aout 2001 20:28
A : [EMAIL PROTECTED]
Objet : [PHP] Sessions in pop-up windows


I'm having some issues passing a session to a pop-up window.

The pop-up window is you average DreamWeaver popup:
L
ink

When you click on the link, the session doesn't get passed. I have
trans-sid enabled.

Any ideas on how I could go about passing my sid?

Thanks,
Chris

--
Chris Cameron
System Administrator
UpNIX Internet Services
http://www.upnix.com/


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



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




[PHP] FrontBase?

2001-08-19 Thread Stephen Cremin

The thread discussing the relative merits of mySQL and PostgreSQL have been
very informative.  I've been looking at the possibility of using FrontBase
(http://www.frontbase.com/), primarily for its support of ACID and Unicode
since I'm primarily working with Chinese, Japanese and Korean data.  Moving
from mySQL to FrontBase also seems to be relatively painless (although that
isn't a consideration for me now choosing a database).  Does anybody have
good/bad experience working with FrontBase?

Stephen

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




[PHP] Two-Byte Regular Expressions

2001-08-19 Thread Stephen Cremin
I note that the latest build of PHP4 comes with Japanese string support. 
Does this include support for two-byte regular expressions?  If yes, does it
also work with Chinese and Korean text?  If no, what other options do I have
without, for example, going through say JPerl or whatever?

Stephen Cremin

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


[PHP] PHP to EJB (Sybase EP, Jaguar engine)

2001-08-19 Thread Alain Fontaine

Hello,

I'm looking for ressources, links, articles, or contacts regarding the above
subject, namely interfacing PHP to an EJB, particularly Sybase Enterprise
Portal (formerly known as Jaguar).

Thanks for any input, I appreciate it.



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




[PHP] Passing variables to a file

2001-08-19 Thread Seb Frost

OK I know this can be done like so:

file.php4?foo=bar

but what if I want to keep the value of foo secret from the user?

- seb

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




[PHP] Re: Help with weird error..

2001-08-19 Thread Richard Lynch

> anyone know what
> Fatal error: input in flex scanner failed in /home/k/kyle/public_html on
line
> means?

Either the PHP compilation itself is whack, or you typed something so unlike
PHP script that you've *really* managed to confuse it...

Do other PHP scripts work?

What's your source look like?

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




[PHP] Re: coding standards

2001-08-19 Thread Richard Lynch

> - Is declaring all variables a good idea - so theres no unassigned
> variables hanging around ? (no warnings produced when error reporting
> set to E_ALL)

You mean INITIALIZING.  There are no variable declarations in PHP.

And, yes, it's a good idea so you're never surprised by a variable that you
end up using twice.

> - Naming of include files - .inc or .php ?
> - naming of class files .inc or .php ?

Name them .inc, *AND* move them outside the web tree if you can++, *AND*
configure Apache to NEVER, EVER serve up an .inc file in any way, shape, or
form.

++ The scale and scope of your project may require so many .inc files with
the same names that you need to place them in the same directory as the PHP
files that use them.  Just be sure Apache won't serve them up.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




[PHP] Re: HTTPS oddity

2001-08-19 Thread Richard Lynch

Try throwing a  on each port and see what else you are
getting...



--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Nigel Jewell <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 12:12 PM
Subject: HTTPS oddity


> Dear all,
>
> I have a SSL server set up and I check in PHP that its running over SSL by
> doing:
>
> if ($HTTPS) {
> ..
> }
>
> This has worked for ages - but sometime last night the behaviour of my/our
> server changed and now over an non-SSL connection, $HTTPS = ON and over a
> SSL connection $HTTPS = on (note the change in case).  This is odd - and I
> can't find the source.
>
> Unfortunately I'm not the only one with admin access to the server - so
> someone may have changed something :(.
>
> Anyone got any ideas?  Where to start looking?
>
> Thanks,
>
> Nige.
>
> --
> URL: http://www.grufty.co.uk
>


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




[PHP] Re: Shuffle Cards Function

2001-08-19 Thread Richard Lynch

http://php.net/shuffle will be much faster and just as random...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Robert Schultz <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 18, 2001 11:37 PM
Subject: Shuffle Cards Function


> I've written a ShuffleCards function that will actually shuffle a deck of
> cards just like would happen in real life (divide the deck in half and
stick
> them into each other with 1-3 cards between each other card)
>
>function ShuffleCards(&$cardsArray, $times)
>{
> // Randomizes where to split within center (-3 to +3 from dead center)
> (MINIMUM 10 CARDS IN DECK)
> // Splits into two array. Randomizes how many cards from left and how
> many cards from right (between 1 and 3)
> // Alternates sides. Continues until both arrays are empty.
> $arraySize = count($cardsArray);
>
> if($arraySize<10)
>  return;
>
> $deadCenter = $arraySize/2;
>
> for($i=0;$i<$times;$i++)
> {
>  reset($cardsArray);
>
>  $cutVariant = rand(-3, 3);
>  $cutLocation = $deadCenter+$cutVariant;
>
>  $firstArray = array();
>  $secondArray = array();
>
>  for($z=0;$z<$arraySize;$z++)
>  {
>   if($z<$cutLocation)
>array_push($firstArray, $cardsArray[$z]);
>   else
>array_push($secondArray, $cardsArray[$z]);
>  }
>
>  $bottomFirst = rand(0, 1);
>  $cardsArray = array();
>
>  while(count($firstArray) && count($secondArray))
>  {
>   $leftNewCards = array();
>   $rightNewCards = array();
>
>   $leftVariant = rand(1, 3);
>   if($leftVariant>count($firstArray))
>$leftVariant = count($firstArray);
>
>   $rightVariant = rand(1, 3);
>   if($rightVariant>count($secondArray))
>$rightVariant = count($secondArray);
>
>
>   for($x=0;$x<$leftVariant;$x++)
>   {
>array_push($leftNewCards, array_shift($firstArray));
>   }
>
>   for($y=0;$y<$rightVariant;$y++)
>   {
>array_push($rightNewCards, array_shift($secondArray));
>   }
>
>   if($bottomFirst==0)
>   {
>$newCardsArray = array_merge($leftNewCards, $rightNewCards);
>$bottomFirst = 1;
>   }
>   else
>   {
>$newCardsArray = array_merge($rightNewCards, $leftNewCards);
>$bottomFirst = 0;
>   }
>
>   reset($newCardsArray);
>
>   while(count($newCardsArray))
>   {
>array_push($cardsArray, array_shift($newCardsArray));
>   }
>  }
>
>  if(count($firstArray))
>  {
>   while(count($firstArray))
>array_push($cardsArray, array_shift($firstArray));
>  }
>  if(count($secondArray))
>  {
>   while(count($secondArray))
>array_push($cardsArray, array_shift($secondArray));
>  }
> }
>}
>
> Robert Schultz - [EMAIL PROTECTED]
>
>
>


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




[PHP] Re: Function to Build Trees

2001-08-19 Thread Richard Lynch

> Given a multidimensional array with words as keys, I want to match
> the values of each array with the keys of the array and build a new
> array that reflects these relationships as a sort of tree.  So, in
> the list below, "fruit", "apples", "oranges", "red" are the keys and
> in the "fruit" array are the values "apples" and "oranges", so I want
> the function to create a new array that looks like:
>
> ORIGINAL ARRAY:
> $array['fruits'] = array("apples","oranges","pears");
> $array['apples'] = array("red","granny smith");
> $array['oranges'] = array('mandarin');
> $array['red'] = array("big red","small red");
>
> NEW ARRAY:
> $array['fruits'] = array(apples,oranges,pears);
> $array['fruits']['apples'] = array("red","granny smith");
> $array['fruits']['oranges'] = array('mandarin');

Something not unlike this:

# UNTESTED CODE:
# Change the 1's to 0's to get rid of debugging output:
function buildTree(&$original, $key = 'fruits', $level = 1){
if (1) echo str_repeat('>', $level), $key, "   ->",
key($original), "\n";
$result = array();
if (is_array($original[$key])){
while (list($k, $v) = each($original[$key])){
$result[$key][$k] = buildTree($v, $k, $level++);
}
}
else{
$result[$key][$k] = $value;
}
if (1) echo str_repeat('<', $level), "\n";
return $result;
}



--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




[PHP] Re: sendmail

2001-08-19 Thread Richard Lynch

> I'm on virtual hosting that lets me configure anything with .htaccess
> file. I was recomended by provider to specify location of sendmail in
> case I want to use php mail() function I know that I may do it in
> htaccess file by adding php_value sendmail_path
> /usr/sbin/sendmail The qwestion is can I do anything else but
> correcting the path in .htaccess, this is the last thing I want to do.

First of all, you'll need:

php_value sendmail_path "/usr/sbin/sendmail -t"

Yes, you need the quotes.
And possibly some other options inside quotes depending on your ISP's
configuration of sendmail.

I don't understand your ISP's rationale for requiring you to do this in
.htaccess instead of just doing it himself...  Either he's letting you use
mail() or he's not.

I also don't understand why you are loathe to do this...  Unless you've
heard ".htaccess is slow" (which it is).  Alas, since your ISP has already
turned on .htaccess support, you're *NOT* causing any additional significant
slow-down to *utilize* the feature.  The slowness is in Apache looking for
the damn file, not in your putting (reasonable) stuff in it.

Oh yeah, to answer your original question :-)

You probably *COULD* set up an SMTP server on some other machine and just
fsockopen() to that SMTP server and spew your emails to that.  This will be
way more faster anyway.  Or, perhaps your ISP has an SMTP server that PHP
can fsockopen() and spew to.  Depends on how he configured it.  There's all
sorts of sample code for this SMTP spewing, so you needn't write it from
scratch -- though it ain't rocket science.  I did it, so it *CANNOT* be that
difficult. :-)

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




[PHP] Re: Sessions in pop-up windows

2001-08-19 Thread Richard Lynch

If Cookies are off, you may need to provide more than just "#" as the HREF.

While "#" will "work", it's not technically speaking a valid URL, and PHP is
probably not inserting the SID into the URL, or else inserting it in the
"wrong" place.

Use "View Source" in your browser to see what PHP is doing to that HREF.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Chris Cameron <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 1:28 PM
Subject: Sessions in pop-up windows


> I'm having some issues passing a session to a pop-up window.
>
> The pop-up window is you average DreamWeaver popup:
> 
onClick="MM_openBrWindow('prod_detail_pop.php','','width=500,height=350')">L
ink
>
> When you click on the link, the session doesn't get passed. I have
> trans-sid enabled.
>
> Any ideas on how I could go about passing my sid?
>
> Thanks,
> Chris
>
> --
> Chris Cameron
> System Administrator
> UpNIX Internet Services
> http://www.upnix.com/
>


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




[PHP] Re: --enable-memory-limit - What does it do?

2001-08-19 Thread Richard Lynch

I think it allows you to COMPILE the darn thing when you've only got, like,
16Mb machine...

Or *MAYBE* it's the thing in php.ini about limiting how much RAM a PHP
script can chew up before puking...

It *SHOULD* be documented on http://php.net in the Installation and
Configuration section.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Kai Schaetzl <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 11:27 AM
Subject: --enable-memory-limit - What does it do?


> Well, there's no explanation for it in the manual and I didn't find
> any by searching all relevant archives with deja. So, what does it
> EXACTLY do when I compile it in and are there configuration options
> for it? (f.i. the amount of memory to limit to ;-)
>
>
> Kai
>
> --
>
> Kai Schätzl, Berlin, Germany
> Get your web at Conactive Internet Services: http://www.conactive.com
> IE-Center: http://ie5.de & http://msie.winware.org
> ClubWin - Help for Windows Users: http://www.clubwin.com
>
>
>


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




[PHP] Re: PHP based authentification -----------

2001-08-19 Thread Richard Lynch

> How can I "logout" from a PHP based auth (with PHP_AUTH_USER and
PHP_AUTH_PW
> and appropriate headers sent at the beginning)?
> It seems like unset($PHP_AUTH_USER) does not wotk in this case...

unset() won't do anything because the *BROWSER* re-sends the
username/password for that Realm when it gets the headers requiring them.

This continues until the user quits the browser, *OR* you stop
authenticating for that Realm and start authenticating for another.

Thus, the way to "logout" is to maintain a dynamic unique dataset of
"Realms" and require authentication in a new Realm for any user that is
"logged out".

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




[PHP] strange upload/db-insert problem with ie5.5

2001-08-19 Thread Serge Adamowsky

dear community,

i've got a script which handles the correct upload of certain documents.
the way:
1)select the document, then upload  through form with method post -> target
same document
2)do the checking stuff with the document, if ok call the same script again
for displaying the property-page -> form-target same document
3) if everything went well, document-properties are inserted in the db in
two tables, then script
displays js-redirect to do more stuff with the doc.
the problem here is, that although no browser goes wrong, except explorer
5.5 (sp2).
using this version, the document's properties are inserted twice, both
relating to the same physical doc
but with different ids.
did anyone ever had same effects or even the remedy for this particular
problem?
(remedy "get rid of stinkin' ms-junk" won't help, since customer is tied to
this trash ;)


thanks
serge



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




[PHP] showing submitted images

2001-08-19 Thread Simon Lysbjerg Hansen

Please help,

I'm trying to submit a .jpg image via a html form and showing it with the
following piece of code




File to show:



 

but I only get the binary contents of the .jpg file. What's wrong?

My hostmaster has an infobar running at the top of my page [check
www.oss-fodbold.dk to see what I mean]. Is this the problem?

Thanks in advance

Simon



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




Re: [PHP] Re: HTTPS oddity

2001-08-19 Thread speedboy

> Try throwing a  on each port and see what else you are
> getting...
> >
> > This has worked for ages - but sometime last night the behaviour of my/our
> > server changed and now over an non-SSL connection, $HTTPS = ON and over a
> > SSL connection $HTTPS = on (note the change in case).  This is odd - and I
> > can't find the source.

I can't remember what I did, but this happened to me as well. I have a check
https function. I restarted apache and I think it worked. phpinfo still showed
the $HTTPS variable but I could not use it inside a function even though I had
it set as a global variable. Try restarting...


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




Re: [PHP] Re: Shuffle Cards Function

2001-08-19 Thread Tom Carter

I could be wrong in thinking this, but wasn't the purpose of the presented
function to shuffle a deck in a deliberately imperfecatly random way? ie.
mimicking a human shuffler beats why one would want to do this as an
academic excersize, but hey, I like it ;-)
- Original Message -
From: "Richard Lynch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 9:45 PM
Subject: [PHP] Re: Shuffle Cards Function


> http://php.net/shuffle will be much faster and just as random...
>
> --
> WARNING [EMAIL PROTECTED] address is an endangered species -- Use
> [EMAIL PROTECTED]
> Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
> - Original Message -
> From: Robert Schultz <[EMAIL PROTECTED]>
> Newsgroups: php.general
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, August 18, 2001 11:37 PM
> Subject: Shuffle Cards Function
>
>
> > I've written a ShuffleCards function that will actually shuffle a deck
of
> > cards just like would happen in real life (divide the deck in half and
> stick
> > them into each other with 1-3 cards between each other card)
> >
> >function ShuffleCards(&$cardsArray, $times)
> >{
> > // Randomizes where to split within center (-3 to +3 from dead
center)
> > (MINIMUM 10 CARDS IN DECK)
> > // Splits into two array. Randomizes how many cards from left and
how
> > many cards from right (between 1 and 3)
> > // Alternates sides. Continues until both arrays are empty.
> > $arraySize = count($cardsArray);
> >
> > if($arraySize<10)
> >  return;
> >
> > $deadCenter = $arraySize/2;
> >
> > for($i=0;$i<$times;$i++)
> > {
> >  reset($cardsArray);
> >
> >  $cutVariant = rand(-3, 3);
> >  $cutLocation = $deadCenter+$cutVariant;
> >
> >  $firstArray = array();
> >  $secondArray = array();
> >
> >  for($z=0;$z<$arraySize;$z++)
> >  {
> >   if($z<$cutLocation)
> >array_push($firstArray, $cardsArray[$z]);
> >   else
> >array_push($secondArray, $cardsArray[$z]);
> >  }
> >
> >  $bottomFirst = rand(0, 1);
> >  $cardsArray = array();
> >
> >  while(count($firstArray) && count($secondArray))
> >  {
> >   $leftNewCards = array();
> >   $rightNewCards = array();
> >
> >   $leftVariant = rand(1, 3);
> >   if($leftVariant>count($firstArray))
> >$leftVariant = count($firstArray);
> >
> >   $rightVariant = rand(1, 3);
> >   if($rightVariant>count($secondArray))
> >$rightVariant = count($secondArray);
> >
> >
> >   for($x=0;$x<$leftVariant;$x++)
> >   {
> >array_push($leftNewCards, array_shift($firstArray));
> >   }
> >
> >   for($y=0;$y<$rightVariant;$y++)
> >   {
> >array_push($rightNewCards, array_shift($secondArray));
> >   }
> >
> >   if($bottomFirst==0)
> >   {
> >$newCardsArray = array_merge($leftNewCards, $rightNewCards);
> >$bottomFirst = 1;
> >   }
> >   else
> >   {
> >$newCardsArray = array_merge($rightNewCards, $leftNewCards);
> >$bottomFirst = 0;
> >   }
> >
> >   reset($newCardsArray);
> >
> >   while(count($newCardsArray))
> >   {
> >array_push($cardsArray, array_shift($newCardsArray));
> >   }
> >  }
> >
> >  if(count($firstArray))
> >  {
> >   while(count($firstArray))
> >array_push($cardsArray, array_shift($firstArray));
> >  }
> >  if(count($secondArray))
> >  {
> >   while(count($secondArray))
> >array_push($cardsArray, array_shift($secondArray));
> >  }
> > }
> >}
> >
> > Robert Schultz - [EMAIL PROTECTED]
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




[PHP] Re: Two-Byte Regular Expressions

2001-08-19 Thread Yasuo Ohgaki
"Stephen Cremin" <[EMAIL PROTECTED]> wrote in message
news:20010819210056.XGVA20588.mta05-svc.ntlworld.com@[62.252.202.64]..
.
> I note that the latest build of PHP4 comes with Japanese string
support.
> Does this include support for two-byte regular expressions?  If yes,
does it
> also work with Chinese and Korean text?  If no, what other options
do I have
> without, for example, going through say JPerl or whatever?

mbstring module does not support multi-byte regex.

There is multi-byte encoding regular expression module called mbregex
which is not a std PHP extension. It probably works with
EUC-TW/EUC-KR.

ftp://night.fminn.nagano.nagano.jp/php4/

I don't use it lately, but I think it comes with Japanese instruction
only.

--
Yasuo Ohgaki




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


[PHP] Include/requrie secure pages

2001-08-19 Thread TomazSa

I can not include / require secure pages (https).
Is that the way it is in php?
If so how can I do that another way?

lp, tomaz


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




[PHP] passing variables between PHP and Perl

2001-08-19 Thread Tom Beidler

I'm integrating a telephony service into a clients site. I'm pretty handy
with PHP but I don't have much knowledge of perl. I've setup up my client's
site using PHP and the service provided me with a Perl script to make the
telephone connection. I used virtual() in my PHP script to pass variables to
the Perl script but now I need to deal with passing the results from the
Perl back to PHP.

Is there something like virtual() in Perl that I could use to relay the
variables back to my script? Can I call up the Perl variables from my PHP
script after virtual()?

Any help would be appreciated.

Tom


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




[PHP] Using mcrypt in PHP

2001-08-19 Thread Dr. Evil


There seems to be no reliable information in the manual about how to
do this.  I'm trying to use mcrypt 2.4 with php4.06, which should be a
compatible combination.

So far, I have gotten it to work like this:

$cypher = MCRYPT_RIJNDAEL_128;
$encrypted = mcrypt_encrypt($cypher, $key, $plaintext, MCRYPT_MODE_ECB); 
$decrypted = mcrypt_decrypt($cypher, $key, $encrypted, MCRYPT_MODE_ECB);

However, when I do this, I get an error saying:

Warning: attempt to use an empty IV, which is NOT recommend in

So I tried to do the same thing with an IV:

$iv = mcrypt_create_iv(mcrypt_get_iv_size($cypher, MCRYPT_MODE_ECB),
MCRYPT_RANDOM);

and then added this $iv as an argument to encrypt and decrypt.  At
this point, it doesn't work, because the iv is different in the
encrypt and decrypt functions, because it is randonly generated.  Is
it true that I need the same iv to encrypt as to decrypt?  I'm just
not understanding how to use this.  All I want to do is to encrypt
stuff and then decrypt it, using a key, right?  It used to work.

Thanks.

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




Re: [PHP] Using mcrypt in PHP

2001-08-19 Thread Jason Brooke

hopefully someone who knows what they're doing can reply to you, but in the
meantime this should get you going - it works for me:

$td = mcrypt_module_open(MCRYPT_TripleDES, "", MCRYPT_MODE_ECB,
"/usr/lib/mcrypt-modes");
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, "your key string here", $iv);

then just use mdecrypt_generic($td, $data) and mcrypt_generic($td, $data)
where $data is your string to encrypt


- Original Message -
From: "Dr. Evil" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 20, 2001 11:03 AM
Subject: [PHP] Using mcrypt in PHP


>
> There seems to be no reliable information in the manual about how to
> do this.  I'm trying to use mcrypt 2.4 with php4.06, which should be a
> compatible combination.
>
> So far, I have gotten it to work like this:
>
> $cypher = MCRYPT_RIJNDAEL_128;
> $encrypted = mcrypt_encrypt($cypher, $key, $plaintext, MCRYPT_MODE_ECB);
> $decrypted = mcrypt_decrypt($cypher, $key, $encrypted, MCRYPT_MODE_ECB);
>
> However, when I do this, I get an error saying:
>
> Warning: attempt to use an empty IV, which is NOT recommend in
>
> So I tried to do the same thing with an IV:
>
> $iv = mcrypt_create_iv(mcrypt_get_iv_size($cypher, MCRYPT_MODE_ECB),
> MCRYPT_RANDOM);
>
> and then added this $iv as an argument to encrypt and decrypt.  At
> this point, it doesn't work, because the iv is different in the
> encrypt and decrypt functions, because it is randonly generated.  Is
> it true that I need the same iv to encrypt as to decrypt?  I'm just
> not understanding how to use this.  All I want to do is to encrypt
> stuff and then decrypt it, using a key, right?  It used to work.
>
> Thanks.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




Re: [PHP] MySQL substrings?

2001-08-19 Thread David Robley

On Mon, 20 Aug 2001 02:12, Chris Lambert wrote:
> It'd help if you have us the mysql_error() returned.
>
> Try the following:
>
> SELECT *, substring_date AS SUBSTRING(date,5,2) FROM $table ORDER BY
> substring_date
>

Date is a reserved word in Mysql. Also, that might work better, after 
renaming the field from date, as

SELECT *, SUBSTRING(datefield,5,2) AS substring_date FROM $table ORDER BY
 substring_date

>
> - Original Message -
> From: Seb Frost <[EMAIL PROTECTED]>
> To: Tom Carter <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Sunday, August 19, 2001 11:19 AM
> Subject: RE: [PHP] MySQL substrings?
>
> | This doesn't work:
> |
> | $result = mysql_query("SELECT * FROM $table ORDER BY
> | SUBSTRING(date,5,2)")
> |
> | Any idea why?
> |
> | - seb
> |

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Oxymoron: Soviet Life.

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




[PHP] array in and out

2001-08-19 Thread Chris Schneck

Since i have little experience with arrays, and the manuals / readme files
online havent been able to help me, I was wondering if anyone had any ideas
why this code doesnt work?

// get the keywords from db
$keyquery = ("select fld_keyword_word from tbl_keyword order by
rand()");
$keyresult = mysql_query($keyquery) or die ("couldnt randomize
words");
// put them into an array

while ($keyrow = mysql_fetch_array($keyresult))
{
$keyword[] = '$keyrow["fld_keyword_word"]';
}

// print the keywords with a function
$mykeywords = implode(", ", $keyword);

function print_keywords()
{
echo ($mykewords);
}


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




Re: [PHP] array in and out

2001-08-19 Thread David Robley

On Mon, 20 Aug 2001 11:25, Chris Schneck wrote:
> Since i have little experience with arrays, and the manuals / readme
> files online havent been able to help me, I was wondering if anyone had
> any ideas why this code doesnt work?
>
> // get the keywords from db
> $keyquery = ("select fld_keyword_word from tbl_keyword order by
> rand()");
> $keyresult = mysql_query($keyquery) or die ("couldnt randomize
> words");
> // put them into an array
>
> while ($keyrow = mysql_fetch_array($keyresult))
> {
> $keyword[] = '$keyrow["fld_keyword_word"]';
> }
>
> // print the keywords with a function
> $mykeywords = implode(", ", $keyword);
>
> function print_keywords()
> {
> echo ($mykewords);
> }

What part doesn't work?

 $keyword[] = '$keyrow["fld_keyword_word"]';

would possibly be better without the single quotes, and I don't se where 
youe are calling the print_keywords function; which wouldn't work as is 
because it doesn't have access to the variable $mykeywords either from 
being passed as a parameter or made available as a global.

Also you misspelled $mykeywords in the function :-)

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   If a fly has no wings would you call him a walk?

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




Re: [PHP] array_unique() and count issue

2001-08-19 Thread David Robley

On Sat, 18 Aug 2001 17:27, CGI GUY wrote:
> OK, I want to count the number of unique elements in
> an array, then print the total.  However, both methods
> I've tried return "1"; the man pages explain that  the
> count() function will return 1 if the var is set but
> not an array. But if you look at the 2nd method esp.,
> I've set an if-else !is_set() alert which doesn't
> appear... Either way, it's a 1.  Help!
>
> Method 1:
>
> 
> $count =
> array_unique(mysql_fetch_array($mysql_result));
>
> $total = count($count);
>
> print($total);
>
> ?>

mysql_fetch_array only grabs the content of one row returned from a DB 
query, and puts it in an array - so your array here only has one element.

> Method 2:
>
> 
> $array = mysql_fetch_array($mysql_result);
>
> $newarray = array_values($array);
>
> if (!is_array($newarray)) {
> print("Not an array");
>
> } else {
>
> $count = array_unique($newarray);
>
> foreach($count as $key => $value)  {
> $count[$key] = $value++;
> }
>
> print($value);
>
>
> }
> ?>

As above. You need to cycle through the results from the DB and add them 
all to the array.

But having said that, it seems to me that what you are really trying to 
do is to return unique entries from the database? In this case, look at 
using the DISTINCT keyword in your SQL query.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Breathing may be hazardous to your health.

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




Re: [PHP] Re: Shuffle Cards Function

2001-08-19 Thread Robert Schultz

Well, I required a function to mimick a human shuffle.
Because the online shuffle was to help the user predict what sort/types of
deals he would get with a given deck based upon a normal human shuffle.

Plus, I've heard some bad things about shuffle, and of course, shuffe
doesn't mimick a non-perfect human shuffle.

Robert Schultz - [EMAIL PROTECTED]


- Original Message -
From: "Tom Carter" <[EMAIL PROTECTED]>
To: "Richard Lynch" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, August 19, 2001 7:00 PM
Subject: Re: [PHP] Re: Shuffle Cards Function


> I could be wrong in thinking this, but wasn't the purpose of the presented
> function to shuffle a deck in a deliberately imperfecatly random way? ie.
> mimicking a human shuffler beats why one would want to do this as an
> academic excersize, but hey, I like it ;-)
> - Original Message -
> From: "Richard Lynch" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, August 19, 2001 9:45 PM
> Subject: [PHP] Re: Shuffle Cards Function
>
>
> > http://php.net/shuffle will be much faster and just as random...
> >
> > --
> > WARNING [EMAIL PROTECTED] address is an endangered species -- Use
> > [EMAIL PROTECTED]
> > Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
> > Volunteer a little time: http://chatmusic.com/volunteer.htm
> > - Original Message -
> > From: Robert Schultz <[EMAIL PROTECTED]>
> > Newsgroups: php.general
> > To: <[EMAIL PROTECTED]>
> > Sent: Saturday, August 18, 2001 11:37 PM
> > Subject: Shuffle Cards Function
> >
> >
> > > I've written a ShuffleCards function that will actually shuffle a deck
> of
> > > cards just like would happen in real life (divide the deck in half and
> > stick
> > > them into each other with 1-3 cards between each other card)
> > >
> > >function ShuffleCards(&$cardsArray, $times)
> > >{
> > > // Randomizes where to split within center (-3 to +3 from dead
> center)
> > > (MINIMUM 10 CARDS IN DECK)
> > > // Splits into two array. Randomizes how many cards from left and
> how
> > > many cards from right (between 1 and 3)
> > > // Alternates sides. Continues until both arrays are empty.
> > > $arraySize = count($cardsArray);
> > >
> > > if($arraySize<10)
> > >  return;
> > >
> > > $deadCenter = $arraySize/2;
> > >
> > > for($i=0;$i<$times;$i++)
> > > {
> > >  reset($cardsArray);
> > >
> > >  $cutVariant = rand(-3, 3);
> > >  $cutLocation = $deadCenter+$cutVariant;
> > >
> > >  $firstArray = array();
> > >  $secondArray = array();
> > >
> > >  for($z=0;$z<$arraySize;$z++)
> > >  {
> > >   if($z<$cutLocation)
> > >array_push($firstArray, $cardsArray[$z]);
> > >   else
> > >array_push($secondArray, $cardsArray[$z]);
> > >  }
> > >
> > >  $bottomFirst = rand(0, 1);
> > >  $cardsArray = array();
> > >
> > >  while(count($firstArray) && count($secondArray))
> > >  {
> > >   $leftNewCards = array();
> > >   $rightNewCards = array();
> > >
> > >   $leftVariant = rand(1, 3);
> > >   if($leftVariant>count($firstArray))
> > >$leftVariant = count($firstArray);
> > >
> > >   $rightVariant = rand(1, 3);
> > >   if($rightVariant>count($secondArray))
> > >$rightVariant = count($secondArray);
> > >
> > >
> > >   for($x=0;$x<$leftVariant;$x++)
> > >   {
> > >array_push($leftNewCards, array_shift($firstArray));
> > >   }
> > >
> > >   for($y=0;$y<$rightVariant;$y++)
> > >   {
> > >array_push($rightNewCards, array_shift($secondArray));
> > >   }
> > >
> > >   if($bottomFirst==0)
> > >   {
> > >$newCardsArray = array_merge($leftNewCards, $rightNewCards);
> > >$bottomFirst = 1;
> > >   }
> > >   else
> > >   {
> > >$newCardsArray = array_merge($rightNewCards, $leftNewCards);
> > >$bottomFirst = 0;
> > >   }
> > >
> > >   reset($newCardsArray);
> > >
> > >   while(count($newCardsArray))
> > >   {
> > >array_push($cardsArray, array_shift($newCardsArray));
> > >   }
> > >  }
> > >
> > >  if(count($firstArray))
> > >  {
> > >   while(count($firstArray))
> > >array_push($cardsArray, array_shift($firstArray));
> > >  }
> > >  if(count($secondArray))
> > >  {
> > >   while(count($secondArray))
> > >array_push($cardsArray, array_shift($secondArray));
> > >  }
> > > }
> > >}
> > >
> > > Robert Schultz - [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-m

[PHP] option tags and WHILE

2001-08-19 Thread CGI GUY

What's wrong with this code?  I keep getting a parse
error at the form/select lines...

$array = mysql_fetch_array($mysql_result) or die("no
go");

print ("");
print ("");
while ($array[1] => $array[0]) {
print ("$array[1]\n");
}
print ("");
print ("");
?>

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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




[PHP] Re: array in and out

2001-08-19 Thread CC Zona

In article <010101c1291b$378fa0a0$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Chris Schneck) wrote:

> function print_keywords()
> {
> echo ($mykewords);
> }

$mykeywords is a global var; it's undefined in the function's local scope.  
Either pass it into the function as a parameter, add it to the $GLOBALS 
array, or declare it as global within the function.



-- 
CC

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




[PHP] Re: option tags and WHILE

2001-08-19 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Cgi Guy) wrote:

> What's wrong with this code?  I keep getting a parse
> error at the form/select lines...

> print ("$array[1]\n");

See if adding curly braces, {$array[1]}, doesn't work better for you.

-- 
CC

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




[PHP] Oudoor database website - waypoints - please review

2001-08-19 Thread WildOutThere

I just got done (am still improving) building a website to share waypoints
and file related.  Database is still thin, but i want to know if the
features work and are intuitive.

www.wildoutthere.com

Features include:
online sketching on maps and topos
user rating system
slide shows
upload files
search features
driving directions (thanks mapblast)
topo maps (thanks topozone)



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




RE: [PHP] Count total

2001-08-19 Thread Don Read


On 19-Aug-2001 Martin Kampherbeek wrote:
> Hi,
> 
> Who can help me with the following problem?
> I have the tables score and totalscore.
> 
> Score:
> id
> userid
> name
> score
> 
> Totalscore:
> userid
> name
> totalscore
> 
> In the table score one user can have mutiple scores. But in totalscore the
> userid is unique. Now I want to count all the score's of a user en place
> this at the same user in totalscore.
> 
> Example of score:
> 11Martin10
> 22John5
> 33Richard   12
> 41Martin  3
> 53Richard8
> 61Martin  7
> 72John15
> 
> So I would like to know the total score of each user.
> But I don't know how to do this. Who can help me out?
> 

REPLACE INTO Totalscore
  SELECT  userid,name,sum(score) from Score GROUP BY userid;

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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




[PHP] flash and mysql

2001-08-19 Thread Jack

Hi people
I want to make a flash file with dynamic content, driven by database(Mysql in this 
case), is there anyone know where can I get more information about this? 
Jack
[EMAIL PROTECTED]
"Love your enemies, it will drive them nuts"



[PHP] unix permission converter

2001-08-19 Thread Raphael Pirker

Hi,

I have written a "Permission Converter" which converts unix permissions (the
ones we know from CHMOD) into a "-" delimited string of numbers. I also made
it that it supports one more level (unix only has 3 different types of
permissions, (r,w,x) while mine can handle a fourth one. Since I'm just a
newbie to PHP, I was wondering whether there is a shorter way of achieving
the same thing. Here is my code:

// $num is the number (range: 1-15)
$done = "";
$result = "";

while ($done != 1) {

if ($num > 8) {
  $num = $num - 8;
  $result = "8-";
} elseif ($num == 8) {
  $result = 8;
  $done = 1;
} elseif ($num > 4) {
  $num = $num - 4;
  $result .= "4-";
} elseif ($num == 4) {
  $result .= 4;
  $done = 1;
} elseif ($num > 2) {
  $result .= "2-1";
  $done = 1;
} elseif ($num == 2) {
  $result .= "2-";
  $done = 1;
} else {
  $result .= "1";
  $done = 1;
}

}

if ((strrpos($result, "-") == strlen($result)-1) && strlen($result) > 1) {
$result = strrev($result);
$result = substr($result, 1);
$result = strrev($result);
}

echo $result;

TIA,

Raphael



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




[PHP] security check - virtual host and mod php setup

2001-08-19 Thread Dave

please hack apart this solution and point out the error/insecure nature of the
setup.

goal, provide php access to name based virtual hosts on FreeBSD boxes

problem, security of PHP access to base system and other user scripts

solution,

apache compiled with suexec
# set user and group to unique
chown USERID:USERID /path/to/user/html/directory

# no public access to any files under here that
# you don't want public reading, like scripts
# with database login information in them
chmod -R 0750 /path/to/user/html/directory

# set group sticky execution...  we will run
# apache as this unique group so may not be needed
chmod g+s /path/to/user/html/directory

>in apache's httpd.conf
# set each virtual host to run any accesses
# as the group USERID giving them only access
# to this directory...  defeats PHP directory
# and shell scripts as long as no public read bits
# are set

ServerName whatever.com
Group USERID



Sufficient?

you end up with http://test1.com and http://test2.com being unable to create PHP
scripts or do listings of any other virtual user directory since they are not of
the same group, but accesses to the site are made by invoking apache as that
group for that session.

directory tree
drwxr-s---  2 user1   user1  512  Aug 19 18:23  vtest1
drwxr-s---  2 user2   user2  512  Aug 19 18:26  vtest2

with directory groups set in the httpd.conf for user1 in vtest1 and user2 in
vtest2, neither user should be able to use PHP filesystem functions to browse
the other directories as long as no public bits are set, and apache server
requests still server the documents from the directories since each users
directory has an Group user1 (or user2) set for his directory in the directory
or virtual container, thus executing the apache requsts as the appropriate user
and not the generic www user.


Please feel free to point out any errors in my logic...  it appears pretty solid
from here.

Dave


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




Re: [PHP] option tags and WHILE

2001-08-19 Thread David Robley

On Mon, 20 Aug 2001 12:23, CGI GUY wrote:
> What's wrong with this code?  I keep getting a parse
> error at the form/select lines...
>
> $array = mysql_fetch_array($mysql_result) or die("no
> go");
>
> print ("");
> print ("");
> while ($array[1] => $array[0]) {
> print (" ">$array[1]\n");
> }
> print ("");
> print ("");
> ?>

That's an, er, interesting script. But it's not going ever to do what I 
think you expect it to.

You need to use while to loop through the rows returned by your SQL 
query, and for each iteration in the while loop, print the values you 
need. Also, if you use extract, you can directly access variables that 
have the same names as the rows in your table, so you don't have to refer 
to array elements.

Frinstance, if you are fetching fields named value and label for this 
exercise, something like:


echo '';
while ($array = mysql_fetch_array($mysql_result)) {
  extract($array);
  echo '' . $label . '';
}
echo '';

Of course, you'll need to put some more info in your  tag and add 
submit buttons and so forth.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Ensign Expendable, step on that rock! - Kirk

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




Fw: [PHP] Re: option tags and WHILE

2001-08-19 Thread Chris Schneck

Thanks to CC Zona and David Robley for their help in gettin this code out.
This code is really nice for satisfying search engines. It offers different
page content every time you refresh and if you feel like spamming, just use
print_keywords(); here and there to be more relevant :) I'll post the code
in case anyone else wishes to use it.

// get the keywords from db
$keyquery = ("select fld_keyword_word from tbl_keyword order by
rand()");
$keyresult = mysql_query($keyquery) or die ("couldnt randomize
words");

// put them into an array
while ($keyrow = mysql_fetch_array($keyresult))
{
$keyword[] = $keyrow["fld_keyword_word"];
}
$mykeywords = implode(", ", $keyword);

// print the keywords with a function
function print_keywords()
{
global $mykeywords;
echo ($mykeywords);
}


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




RE: [PHP] option tags and WHILE

2001-08-19 Thread Rudolf Visagie

Also

while ($array[1] >= $array[0]) {

and not

while ($array[1] => $array[0]) {

Rudolf Visagie
[EMAIL PROTECTED]

-Original Message-
From: David Robley [mailto:[EMAIL PROTECTED]]
Sent: 20 August 2001 07:01
To: CGI GUY; [EMAIL PROTECTED]
Subject: Re: [PHP] option tags and WHILE


On Mon, 20 Aug 2001 12:23, CGI GUY wrote:
> What's wrong with this code?  I keep getting a parse
> error at the form/select lines...
>
> $array = mysql_fetch_array($mysql_result) or die("no
> go");
>
> print ("");
> print ("");
> while ($array[1] => $array[0]) {
> print (" ">$array[1]\n");
> }
> print ("");
> print ("");
> ?>

That's an, er, interesting script. But it's not going ever to do what I 
think you expect it to.

You need to use while to loop through the rows returned by your SQL 
query, and for each iteration in the while loop, print the values you 
need. Also, if you use extract, you can directly access variables that 
have the same names as the rows in your table, so you don't have to refer 
to array elements.

Frinstance, if you are fetching fields named value and label for this 
exercise, something like:


echo '';
while ($array = mysql_fetch_array($mysql_result)) {
  extract($array);
  echo '' . $label . '';
}
echo '';

Of course, you'll need to put some more info in your  tag and add 
submit buttons and so forth.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Ensign Expendable, step on that rock! - Kirk

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

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




Re: [PHP] Virtual Servers (apache) and php

2001-08-19 Thread B. van Ouwerkerk


>AddType application/x-httpd-php .php .php3
> AddType application/x-httpd-php-source .phps

If those lines aren't you should get your code in your browser.

403 might be a rights issue. Say you created the file you're trying to open 
as root you should chown it to the user under which apache is running.. or 
to another normal user..

Bye,


B.


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




Re: Fw: [PHP] Re: option tags and WHILE

2001-08-19 Thread David Robley

On Mon, 20 Aug 2001 15:05, Chris Schneck wrote:
> Thanks to CC Zona and David Robley for their help in gettin this code
> out. This code is really nice for satisfying search engines. It offers
> different page content every time you refresh and if you feel like
> spamming, just use print_keywords(); here and there to be more relevant
> :) I'll post the code in case anyone else wishes to use it.
>
> // get the keywords from db
> $keyquery = ("select fld_keyword_word from tbl_keyword order by
> rand()");
> $keyresult = mysql_query($keyquery) or die ("couldnt randomize
> words");
>
> // put them into an array
> while ($keyrow = mysql_fetch_array($keyresult))
> {
> $keyword[] = $keyrow["fld_keyword_word"];
> }
> $mykeywords = implode(", ", $keyword);
>
> // print the keywords with a function
> function print_keywords()
> {
> global $mykeywords;
> echo ($mykeywords);
> }

Oh, is that what you wanted to do? Lets cut the processing down by 
eliminating the duplication of effort :-) ie get rid of the 'Put it in an 
array; take it out of an array;print it'.

// get the keywords from db
$keyquery = ("select fld_keyword_word from tbl_keyword order by rand()");
$keyresult = mysql_query($keyquery) or die ("couldnt randomize words");
// Print the keywords
while($row = mysql_fetch_array($result)) {
  extract $row;
  echo $fld_keyword_word;
}


-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   To a cat, "NO!" means "Not while I'm looking."

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




[PHP] flash and php

2001-08-19 Thread Jack

I know this issue has been talk a lot already, but can anyone guide me where can I 
find information about how to build a dynamic content flash file driven by database?
Jack
[EMAIL PROTECTED]
"Love your enemies, it will drive them nuts"



[PHP] print two Digits after decimal point

2001-08-19 Thread Andonny

Hi,
I need to print on the webpage two digits after the decimal point.
This is what I have at the moment:

I need to have for example $5.00 not   $ 5 as it does at the moment.

Thanks for your help
Andonny



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




RE: [PHP] print two Digits after decimal point

2001-08-19 Thread Fotwun



> -Original Message-
> From: Andonny [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 19, 2001 11:21 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] print two Digits after decimal point
> 
> 
> Hi,
> I need to print on the webpage two digits after the decimal point.
> This is what I have at the moment:
> 
> I need to have for example $5.00 not   $ 5 as it does at the moment.
> 
> Thanks for your help
> Andonny
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 

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




[PHP] GD & ISAPI don't work

2001-08-19 Thread Juraj Hasko

Hi,

I've encounter strange problem with GD library. I'm running PHP 4.0.6 on WinNT 4.0 and 
IIS 4.0. While I use CGI version, each of extensions including php_gd.dll works fine. 
But when I try change it to ISAPI, it works but without php_gd.dll. All others 
libraries works fine, but when I add GD lib. IIS will not start with error message:
"A system error has occured.
System error 1067 has occured.
The proces terminated unexpectedly."
Do you have any idea how to solve this problem ?
Thank you in advance,

Juraj Hasko
System Administrator

CAC LEASING Slovakia, a.s.
mailto:[EMAIL PROTECTED]
http://www.cacleasing.sk



Re: [PHP] Passing variables to a file

2001-08-19 Thread Daniel Rezny

Hello Seb,

Sunday, August 19, 2001, 11:44:59 PM, you wrote:

SF> OK I know this can be done like so:

SF> file.php4?foo=bar

SF> but what if I want to keep the value of foo secret from the user?

SF> - seb


I don't know if it's best idea but you can try to encode link with
base64_encode() and base64_decode function.

And this is secret for most users.

I hope it helps

-- 
Best regards,
 Danielmailto:[EMAIL PROTECTED]


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




Re: [PHP] Oudoor database website - waypoints - please review

2001-08-19 Thread B. van Ouwerkerk

At 21:07 19-8-01 -0600, WildOutThere wrote:
>I just got done (am still improving) building a website to share waypoints
>and file related.  Database is still thin, but i want to know if the
>features work and are intuitive.

You should figure out by yourself whether it works or not.

Two little remarks:
- view your website with 800x600
- pictures with a size of 77kB are to big

Bye,


B.


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




[PHP] E-Commerce - Integrating Sessions With Charging Processes That rePOST

2001-08-19 Thread Fotwun

Hi,

I have basically seen and used two methods for integrating credit card
gateways into PHP code.

The first method is one that opens a socket to the gateway server and sends
the data from within the code.

The second is where FORM data is posted to a https URL with the URL is
should send the response back to, with the confirmation code, etc.

I traditionally use PG for situations of e-commerce, mainly because of
transactions. I like the first method better, because I feel it is more
secure, seemless, and less chance for errors to occur (either user induced,
or other problems). I like being able to store all of the required data in
sessions (rather than adding to the DB at each step) and then making all of
the transactional queries at the end of the credit card charging process.

The problem I face is that all of the companies I've researched that allow
direct socket integration seem to charge quite a bit more in general than
those that use the POST/REDIRECT method of charging.  So, if anyone
knows of a reliable and affordable company that allows socket integration,
that would solve the problem best. 

However, because of budget issues, I may need to use one of these cheaper
companies, who ultimately use the POST/REDIRECT method.

My questions are how do you securly, reliably, and seemlessly integrate
sessions within that type of gateway. Because once the form data is posted
to the credit card gateway, it redirects (posts response data) back to the
script of your choice. However, in my experience, the sessions are not
restored/recognized until the browser is refreshed on the client side
(through the use of JavaScript) to get the server to recognize the request
as coming from your user, rather than the as a post from the gateway. I
don't want to have to deal with getting sloppy and adding additional
refreshes/java script if thats the only way to do it. If I were to merely
have the code generate a form based on hidden tags and have javascript
auto-form submit, then I would open to security problems, because I could no
longer restrict the script the gateway respondes to by an HTTP_REFFER.

Because the clients order id that is generated will be stored as a session,
I need a way to reference the order ID and confirmation code that is
returned by the posted data from the gateway, against the session data to
start inserting the data into the DB if it was a successful charge.

Any ideas...? Maybe there's a quick solution out there I am just
overlooking. The solution would be easy if I wasn't inserting all of my data
at the end of the process based on the session data. But this is how the
code is has to work, so what do you all think, how should I deal with this?

Thanks,

FT


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