[PHP] Accumulated Information in DB??

2003-10-01 Thread irinchiang


Hi all, 
   I am having some doubts here and hope to hear some advices/solutions from
all of you out there. Right now, I have a daily, weekly, monthly and yearly
reports which stores information on all my customers. These info will of course,
be stored in the DB.(MySQL). As all these reports are not to be deleted, it will
accumulate as years go by. And so, my question is: is it possible to have such a
system in my project and how should I go about doing it??Can the MySQL DB hold
all this big chunk of info?

These report info are to be viewed in a graphical format(PHP Graph)later on

Regards, 
Irin.

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



[PHP] Select multiple payment mode

2003-10-01 Thread irinchiang


Hi all, 
   I am working on a receipt payment system whereby there is a select box
with a list of payment mode: eg.By cash, By Nets, By Cheque etc...for customers
to select the kinda payment mode they going to make their payment. How ever,
there is   cases in which instead of selecting only one payment mode. They pay
through two payment modes eg.Cheque+cash. In this case, how can I go about doing
it using HTML MySQL and PHP ??how should the DB be like?HTML and PHP???

Regards, 
Irin.

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



RE: [PHP] Accumulated Information in DB??

2003-10-01 Thread Cody Phanekham
 -Original Message-
 From: [EMAIL PROTECTED] 
 Can the MySQL DB hold
 all this big chunk of info?
 

I'm no authority on MySQL but i dont see any problems with holding 'big chucks' of 
info, The only limiting factor would be the size of your hard drive.

You might get a more accurate answer from the MySQL mailing list:

http://lists.mysql.com/


*
This e-mail, including any attachments to it, may contain confidential and/or personal 
information.
If you have received this e-mail in error, you must not copy, distribute, or disclose 
it, use or take any action 
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then delete the 
original e-mail.

The information contained within this e-mail may be solely the opinion of the sender 
and may not necessarily 
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to Salmat's 
anti-virus systems.

For more information, visit our website at  www.salmat.com.au.
*

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



[PHP] File question

2003-10-01 Thread ketvin



Dear geniuses,


A simple question here, i have a file, says, 
list.txt 

it is a simple text fileand simple field 
like:

aa , bb , cc , dd



now i want to usephp script to read that 
list.txt file, and put the data in an array, is there any simple way i could do 
that ? 


thanks 
___

This mail is protected by Silicon Communications S/B

The information contained in this message maybe confidential and protected from 
disclosure. If you are not the intended recipient of this message,  please delete this 
message immediately. You are hereby notified that any dissemination, distribution or 
copying of this communication is strictly prohibited.  


~~~This email has been scanned by our anti-virus system. For precaution, please make 
sure you scan every attachment in this email. Please use at your own risk. Thank you. 
:) Mailadmin~~~ 
___

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

Re: [PHP] File question

2003-10-01 Thread - Edwin -
Hi,

I'm no genius ;) but...

ketvin [EMAIL PROTECTED] wrote:

 Dear geniuses,
 
 
 A simple question here, i have a file, says, list.txt 
 
 it is a simple text file and simple field like:
 
 aa , bb , cc , dd
 
 now i want to use php script to read that list.txt file, and put the
 data in an array, is there any simple way i could do that ? 
 

...maybe you're looking for this:

  http://www.php.net/fgetcsv

Or, just check the other (file) functions here:

  http://www.php.net/manual/en/ref.filesystem.php

- E -

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



RE: [PHP] File question

2003-10-01 Thread Martin Towell
Try something like this (quick and dirty...)
 
$file_array = file(list.txt);
$myarray = explode(,, $file_array[0]);
 
HTH
Martin
 
-Original Message-
From: ketvin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 1 October 2003 5:05 PM
To: [EMAIL PROTECTED]
Subject: [PHP] File question


Dear geniuses,
 
 
A simple question here, i have a file, says, list.txt 
 
it is a simple text file and simple field like:
 
aa , bb , cc , dd
 
 
 
now i want to use php script to read that list.txt file, and put the data in
an array, is there any simple way i could do that ? 
 
 
thanks 


[PHP] Calculate total amount from input

2003-10-01 Thread irinchiang


Hi all, 
   A PHP question to ask: I am using PHP to do a calculation of the total of
fields where user actually input the amount into the text field and I will
calculate the TOTAL from the fields as well as the GST.
Wonder how should I go about doing that?

I did something like :
   $total = $_POST[field 1] + $_POST[field 2] + $_POST[field 3];
   $total = number_format($total, 2, .,  );
   echo $$totalbr;
   echo $.$total.br;

but it wasn't successful.
Hope to get some help here.
All comments/advice/solutions are welcomed=)

Regards, 
Irin.

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



Re: [PHP] Page cannot be displayed

2003-10-01 Thread Olivier Simah
Ok, first Apache is running because I can see any other pages that are not
PHP
Second php.ini and everything inside look like in place : This is not my
first installation of AMP on a Windows system but this is the first time I
have this reaction.
I can't display the phpinfo and for sur all the pages named .php can't be
displayed...
the root is changed (index.html is seen)
What is funny is that the same Apache.conf and php.ini works perfectly in my
other computer...
Here is a piece of the error.log :


[Tue Sep 30 20:05:57 2003] [notice] Parent: Created child process 4028
[Tue Sep 30 20:05:57 2003] [debug] mpm_winnt.c(505): Parent: Sent the
scoreboard to the child
[Tue Sep 30 20:05:57 2003] [notice] Child 4028: Child process is running
[Tue Sep 30 20:05:57 2003] [debug] mpm_winnt.c(426): Child 4028: Retrieved
our scoreboard from the parent.
[Tue Sep 30 20:05:57 2003] [info] Parent: Duplicating socket 208 and sending
it to child process 4028
[Tue Sep 30 20:05:58 2003] [debug] mpm_winnt.c(623): Parent: Sent 1
listeners to child 4028
[Tue Sep 30 20:05:58 2003] [debug] mpm_winnt.c(582): Child 4028: retrieved 1
listeners from parent
[Tue Sep 30 20:05:58 2003] [notice] Child 4028: Acquired the start mutex.
[Tue Sep 30 20:05:58 2003] [notice] Child 4028: Starting 250 worker threads.
[Tue Sep 30 20:05:58 2003] [debug] child.c(695): Child 4028: Worker thread 0
starting.
[Tue Sep 30 20:05:58 2003] [debug] child.c(695): Child 4028: Worker thread 1
starting.

Thanks

Burhan Khalid [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Olivier Simah wrote:

  Hi,
  I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
  Windows XP.
  When I try to see a HTML pages, everything is ok but when it comes to
PHP
  pages nothing works
  I have this message with IE : The page cannot be displayed
  with Opera 7, Mozilla : nothing

 Try this http://www.meidomus.com/node/view/3


 -- 
 Burhan Khalid
 phplist[at]meidomus[dot]com
 http://www.meidomus.com

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



[PHP] mmcache problems

2003-10-01 Thread Eugene Lee
Just tried installing Turck MMCache 2.4.1 on a FreeBSD box.  After
tweaking the configure script:

./configure --enable-mmcache=shared 
--with-php-config=/usr/local/bin/php-config --prefix=/usr/local

I got it to compile and install in:

/usr/local/lib/php/extensions/no-debug-non-zts-20020429/mmcache.so

But when I try to run it, I get this error (also reported in php -m):

PHP Warning:  Unknown(): Unable to load dynamic library './mmcache.so' - 
Cannot open quot;./mmcache.soquot; in Unknown on line 0

Not a very descriptive error message.  I appreciate any suggestions!

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



Re: [PHP] File question

2003-10-01 Thread Raditha Dissanayake
Hi Edwin,
Didn't you read the disclaimer? you could be in serious trouble.
- Edwin - wrote:

Hi,

I'm no genius ;) but...

ketvin [EMAIL PROTECTED] wrote:

 

Dear geniuses,

A simple question here, i have a file, says, list.txt 

it is a simple text file and simple field like:

aa , bb , cc , dd

now i want to use php script to read that list.txt file, and put the
data in an array, is there any simple way i could do that ? 

   

...maybe you're looking for this:

 http://www.php.net/fgetcsv

Or, just check the other (file) functions here:

 http://www.php.net/manual/en/ref.filesystem.php

- E -

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/
 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/  |  http://www.raditha/megaupload/
Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB  |  with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Generate Receipt Number

2003-10-01 Thread - Edwin -
Hi,

Just to add...

Larry E. Ullman [EMAIL PROTECTED] wrote:

 I am doing a receipt system whereby it can auto generate a 
  unique receipt
  number for each receipt. It will be an increment of number
  eg.01, 02,
  03, and so on.Wonder how should I go about doing this
  using PHP? Do need
  some help here..technologies used are:PHP and MySQL...
 
 Since you're using MySQL, create a table for your receipts with a 
 receipt_number which is an auto_incremented, primary key, unsigned,
 not null, integer. When you add records to this, set this column's
 value to NULL or 0 and it will automatically use the next sequential
 number.

...and maybe zerofill will be useful here as well...

 See the MySQL manual for more.

(To the OP - ) This is a good habit to acquire... ;)

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



Re: [PHP] PNGs PHP feedback

2003-10-01 Thread - Edwin -
(Sorry if this is becoming OT...)

Eugene Lee [EMAIL PROTECTED] wrote:

 (about M$IE and PNG)
 
 On Wed, Oct 01, 2003 at 11:31:46AM +0900, - Edwin - wrote:
 : 
 : Curt Zirzow [EMAIL PROTECTED] wrote:
 : 
 :  It does have a problem reading alpha channels in the pngs
 though.: 
 : Quite true. (I forgot that part...) Though it seems like it's
 not a: problem for the IE on Macs...
 
 M$IE for the Mac uses a completely different codebase from the
 Windoze version and started with the home-grown Tasman engine, which
 at the time was probably the most standards-compliant engine
 compared to anything else on any other platform.

Surprise, surprise! ? I heard they stopped the development of IE for
Mac. Too bad...

 : ...and then I thought IE's problems were all about security and
 : non-standard tags... ;)
 
 The M$ way is embrace, extend, extinguish.
 
   http://www.wikipedia.org/wiki/Embrace,_extend_and_extinguish

'Seems like ^this^ doesn't work on OS X... Or, maybe they'll find a
way to buy Safari? ;)

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



Re: [PHP] File question

2003-10-01 Thread - Edwin -
Hi Raditha,

Raditha Dissanayake [EMAIL PROTECTED] wrote:

 Hi Edwin,
 Didn't you read the disclaimer? you could be in serious trouble.

...[snip]...

Disclaimer? No, not really. I've been sleeping for a long time...
Maybe, you can tell me...

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



Re: [PHP] File question

2003-10-01 Thread - Edwin -
Hehe...

- Edwin - [EMAIL PROTECTED] wrote:

 Hi Raditha,
 
 Raditha Dissanayake [EMAIL PROTECTED] wrote:
 
  Hi Edwin,
  Didn't you read the disclaimer? you could be in serious trouble.
 
 ...[snip]...
 
 Disclaimer? No, not really. I've been sleeping for a long time...
 Maybe, you can tell me...

I got it... Kinda slow today... still drowsy...

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



[PHP] getting image width,height

2003-10-01 Thread Fatih Olcer
how can i get the image width and height ?
thanks.
Fatih.

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



Re: [PHP] PNGs PHP feedback

2003-10-01 Thread Eugene Lee
On Wed, Oct 01, 2003 at 04:41:28PM +0900, - Edwin - wrote:
: 
: (Sorry if this is becoming OT...)
: 
: Eugene Lee [EMAIL PROTECTED] wrote:
:  
:  M$IE for the Mac uses a completely different codebase from the
:  Windoze version and started with the home-grown Tasman engine, which
:  at the time was probably the most standards-compliant engine
:  compared to anything else on any other platform.
: 
: Surprise, surprise! ? I heard they stopped the development of IE for
: Mac. Too bad...

Yep, M$ has halted development of IE for the Mac for a while.  But
except for your regularly scheduled security fixes, M$ has halted
development of IE for Windoze as well!  This is really annoying for
me as a web developer because I can't take full advantage of CSS.
I stopped using IE to check for the HTML correctness of my PHP code.
As long as stick with simple CSS features, I now jump between Safari,
Mozilla, and the W3C validators.

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



Re: [PHP] getting image width,height

2003-10-01 Thread - Edwin -
Hi,

Fatih Olcer [EMAIL PROTECTED] wrote:

 how can i get the image width and height ?

  http://www.php.net/function.getimagesize ?

Or, is this a trick question? :)

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



Re: [PHP] getting image width,height

2003-10-01 Thread Eugene Lee
On Wed, Oct 01, 2003 at 11:02:47AM +0300, Fatih Olcer wrote:
: 
: how can i get the image width and height ?

1. imagesx() and imagesy().

2. please try checking the online manual first, in the appropriate section:

http://www.php.net/manual/en/ref.image.php

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



Re: [PHP] PNGs PHP feedback

2003-10-01 Thread - Edwin -
On Wed, 1 Oct 2003 03:03:42 -0500
Eugene Lee [EMAIL PROTECTED] wrote:

...[snip]...

 Yep, M$ has halted development of IE for the Mac for a while.  But
 except for your regularly scheduled security fixes, M$ has halted
 development of IE for Windoze as well!

?? That's new! ('Must have been inside my cave for a long time...) I'm
sure next time you're going to tell me that they're making a new
standards-compliant browser based on mozilla ;)

 This is really annoying for
 me as a web developer because I can't take full advantage of CSS.
 I stopped using IE to check for the HTML correctness of my PHP code.
 As long as stick with simple CSS features, I now jump between
 Safari, Mozilla, and the W3C validators.

Good idea!

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



Re: [PHP] Accumulated Information in DB??

2003-10-01 Thread Petre Agenbag
As the previous comment states: MySQL is a DB, it's built to store data,
so it's pretty good at it, and the limiting factors re usually your
hardware/OS.
However, just one thought. I am always very protective of my databases.
If data is never going to change and no other process will be accessing
the data , then I usually think twice before i store it in a db. It
sounds to me like these reports are pretty static once they are run,
ie, they are date dependant ( report xyz for the period 2000-01-01 to
2001-01-01), and arguably, the data that was used to generate that
specific report is also fixed in history. So my assumption would be
that the report would also never change again. So, if that is the case,
why not generate the report, and simply save the static html version
of the report on the file system as a normal html file?

If your reports are not as my assumption states, then simply store them
in mysql, i assure you it can handle it. As I stated, you must just be
aware of hardware and your OS/filesystem limitation wrt table sizes.


On Wed, 2003-10-01 at 08:39, [EMAIL PROTECTED] wrote:
 Hi all, 
I am having some doubts here and hope to hear some advices/solutions from
 all of you out there. Right now, I have a daily, weekly, monthly and yearly
 reports which stores information on all my customers. These info will of course,
 be stored in the DB.(MySQL). As all these reports are not to be deleted, it will
 accumulate as years go by. And so, my question is: is it possible to have such a
 system in my project and how should I go about doing it??Can the MySQL DB hold
 all this big chunk of info?
 
 These report info are to be viewed in a graphical format(PHP Graph)later on
 
 Regards, 
 Irin.

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



RE: [PHP] Select multiple payment mode

2003-10-01 Thread Ralph Guzman
I guess the thing to do would be to log in payments in the database. So lets
say the total is $50.00, if the user pays $25 on cc and payment is
authorized, then log this into the database, then show the remaining
balance. At this point you can give user the option to pay the remaining
balance using a different payment method.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2003 11:58 PM
To: PHP General list
Subject: [PHP] Select multiple payment mode



Hi all, 
   I am working on a receipt payment system whereby there is a select
box
with a list of payment mode: eg.By cash, By Nets, By Cheque etc...for
customers
to select the kinda payment mode they going to make their payment. How ever,
there is   cases in which instead of selecting only one payment mode. They
pay
through two payment modes eg.Cheque+cash. In this case, how can I go about
doing
it using HTML MySQL and PHP ??how should the DB be like?HTML and PHP???

Regards, 
Irin.

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

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



Re: [PHP] Calculate total amount from input

2003-10-01 Thread Burhan Khalid
[EMAIL PROTECTED] wrote:
Hi all, 
   A PHP question to ask: I am using PHP to do a calculation of the total of
fields where user actually input the amount into the text field and I will
calculate the TOTAL from the fields as well as the GST.
Wonder how should I go about doing that?

I did something like :
   $total = $_POST[field 1] + $_POST[field 2] + $_POST[field 3];
   $total = number_format($total, 2, .,  );
   echo $$totalbr;
   echo $.$total.br;
but it wasn't successful.
What do you mean it wasn't successful? What did you get on the screen? 
Are you sure that the fields are being referenced correctly? Something 
like this would use some error checking :

$total  = 0;
$errors = ;
if($_POST[field 1])
{
   $total += intval($_POST[field 1]);
} else { $errors .= Field 1 not entered; }
if($_POST[field 2])
{
   $total += intval($_POST[field 2]);
} else { $errors .= Field 2 not entered; }
if($_POST[field 3])
{
   $total += intval($_POST[field 3]);
} else { $errors .= Field 3 not entered; }
if ($errors != )
{
   echo Errors : .$errors;
}
$total = number_format($total, 2, '.', '');
echo Total is \$ .$total;
--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Page cannot be displayed

2003-10-01 Thread Olivier Simah
Hi,
I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
Windows XP.
When I try to see a HTML pages, everything is ok but when it comes to PHP
pages nothing works
I have this message with IE : The page cannot be displayed with Opera 7,
Mozilla : nothing
Ok, first Apache is running because I can see any other pages that are not
PHP
Second php.ini and everything inside look like in place : This is not my
first installation of AMP on a Windows system but this is the first time I
have this reaction.
I can't display the phpinfo and for sur all the pages named .php can't be
displayed... the root is changed (index.html is seen)
What is funny is that the same Apache.conf and php.ini works perfectly in my
other computer...
Here is a piece of the error.log :


[Tue Sep 30 20:05:57 2003] [notice] Parent: Created child process 4028
[Tue Sep 30 20:05:57 2003] [debug] mpm_winnt.c(505): Parent: Sent the
scoreboard to the child
[Tue Sep 30 20:05:57 2003] [notice] Child 4028: Child process is running
[Tue Sep 30 20:05:57 2003] [debug] mpm_winnt.c(426): Child 4028: Retrieved
our scoreboard from the parent.
[Tue Sep 30 20:05:57 2003] [info] Parent: Duplicating socket 208 and sending
it to child process 4028
[Tue Sep 30 20:05:58 2003] [debug] mpm_winnt.c(623): Parent: Sent 1
listeners to child 4028
[Tue Sep 30 20:05:58 2003] [debug] mpm_winnt.c(582): Child 4028: retrieved 1
listeners from parent
[Tue Sep 30 20:05:58 2003] [notice] Child 4028: Acquired the start mutex.
[Tue Sep 30 20:05:58 2003] [notice] Child 4028: Starting 250 worker threads.
[Tue Sep 30 20:05:58 2003] [debug] child.c(695): Child 4028: Worker thread 0
starting.
[Tue Sep 30 20:05:58 2003] [debug] child.c(695): Child 4028: Worker thread 1
starting.




HELP

Thanks
Olivier

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



[PHP] DST change dates

2003-10-01 Thread Germán M. Rivera
Hi all!

   I would like my script to get the dates of the year when the server 
local time changes from winter time to summer time and vice-versa. ¿Does 
anybody know how to do it in PHP, even calling linux functions (with 
popen) or exploring linux archives? I need it to create a VTIMEZONE 
component in ICalendar.

Thank you!

Germán

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


[PHP] array_diff()

2003-10-01 Thread Angelo Zanetti
HI all,

I looked at the PHP manual and it doesnt say much about this function. what
I want to know is that, do the 2 arrays have to have the same length of
number of elements?

TIA

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



Re: [PHP] array_diff()

2003-10-01 Thread Eugene Lee
On Wed, Oct 01, 2003 at 11:49:29AM +0200, Angelo Zanetti wrote:
: 
: I looked at the PHP manual and it doesnt say much about this function.
: what I want to know is that, do the 2 arrays have to have the same
: length of number of elements?

Nope.

Re-examine Example 1: $array1 and $array2 are different sizes.

http://www.php.net/manual/en/function.array-diff.php

?php
$array1 = array(a = green, red, blue, red);
$array2 = array(b = green, yellow, red);
$result = array_diff($array1, $array2);
?

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



Re: [PHP] mmcache problems

2003-10-01 Thread Jason Wong
On Wednesday 01 October 2003 15:22, Eugene Lee wrote:
 Just tried installing Turck MMCache 2.4.1 on a FreeBSD box.  After
 tweaking the configure script:

   ./configure --enable-mmcache=shared
 --with-php-config=/usr/local/bin/php-config --prefix=/usr/local

 I got it to compile and install in:

   /usr/local/lib/php/extensions/no-debug-non-zts-20020429/mmcache.so

 But when I try to run it, I get this error (also reported in php -m):

   PHP Warning:  Unknown(): Unable to load dynamic library './mmcache.so' -
 Cannot open quot;./mmcache.soquot; in Unknown on line 0

 Not a very descriptive error message.  I appreciate any suggestions!

Set your extension_dir (in php.ini) to wherever your mmcache.so (and hopefully 
all your other extensions) are stored.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If you must work on your flight, you will experience turbulence as soon as you 
touch pen to paper
-- Murphy's Laws for Frequent Flyers n5
*/

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



[PHP] removing an element from an array

2003-10-01 Thread Angelo Zanetti
Hi

If I have an array and want to remove and element from this array. correct
me if this is the wrong approach:

create a temporary array with 1 element less than the origional array, get
the position of the element ( is there a function for this?) and then run
through the origional array copying all elements besides the element which
is meant to be removed.

Is there no function to do this? It seems like alot of overhead to do this
process, especially if the array is big. comments?

Angelo

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



RE: [PHP] array_diff()

2003-10-01 Thread Daniel Perez Clavero
No, but need to have same data types. You cannot compare String against
Integers and so

Regards

-Original Message-
From: Angelo Zanetti [mailto:[EMAIL PROTECTED]
Sent: miércoles, 01 de octubre de 2003 11:49
To: [EMAIL PROTECTED]
Subject: [PHP] array_diff()


HI all,

I looked at the PHP manual and it doesnt say much about this function. what
I want to know is that, do the 2 arrays have to have the same length of
number of elements?

TIA

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

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



[PHP] quick i need some help please

2003-10-01 Thread PAUL FERRIE
i have a admin section for a new site that i have built, to cut a long story
short
the submit form adds news stories to the site.  For some reason behound me
the php script is converting  to a square.
It is a flash based admin area not yet sure if this is an issuse, i just got
the call :(
the font being used is a system defult font (arial).

thanks
Paul

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



[PHP] CURL + https

2003-10-01 Thread Yonatan Ben-Nes
Hi,

I'm currently building an e-commerce site and I need to create the connection between 
the site and the server which validate the credit card.
I'm trying to do it with CURL which will post all the information from a secured page 
(https) to another secure page, the code that i succeded to create so far is able to 
send from one secured page to another at my server but from some reason isnt able to 
connect to the cc server, when i tried to use curl through the shell i succeded to 
connect.

The code that im trying is (i reduced the amount of variables for the snippet):
 $OrderID = OrderID=.$OrderID.;
 $total = total=.$total.;
 $URL = URL=http://www.curtaincallproductions.com/ccall08/html/order/auth.phtml;;
 $email = email=.$b_email.;
 $Cardnum1 = Cardnum1=.$Cardnum[1].; 
 $Cardnum2 = Cardnum2=.$Cardnum[2].; 
 $Cardnum3 = Cardnum3=.$Cardnum[3].; 
 $Cardnum4 = Cardnum4=.$Cardnum[4].; 
 $Cardname = Cardname=.$Cardname; 
 
 $params = 
$OrderID.$total.$URL.$email.$Cardnum1.$Cardnum2.$Cardnum3.$Cardnum4.$Cardname;
 $params = str_replace( , %20, $params);
 $user_agent = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0);

 $ch = curl_init('https://www.goemerchant7.com/cgi-bin/gateway/direct.cgi');
 curl_setopt($ch, CURLOPT_POST, 1); // make a regular post
 curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
 curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); //user-agent header to be used 
 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); 
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

 $result = curl_exec ($ch);
 curl_close ($ch);
 }

Anyone know what can be the problem?
I also know that if i just create a static form which post to the cc server the cc 
return me an error, with curl i cant know what is the error... or can i?

Thanks Alot in advance,
--
My friends are worth gold to me, so I prefer to sell them and get rich!

Ben-Nes Yonatan
Canaan Surfing Ltd
Tel: 972-4-6991122
Fax: 972-4-6990098
http://sites.canaan.co.il
--

[PHP] unable to get response from server program

2003-10-01 Thread Amarnath R
Hi all,
  I am facing some problem in socket_recvfrom() in php.

I am creating a udp socket and sending request to the server(is basically a
c program).
I am unable to recive the response from  server.I am using UNIX domain
sockets.
sample of code,what I am using.

?php
$PHPDG_PATH =/var/ph.unixdg;
$PHPDG_TMP = /var/php.xx;
$service_port = 0;
$socket = socket_create (AF_UNIX, SOCK_DGRAM, 0);
if ($socket == FALSE)
{
   echo socket_create() failed: reason:  . socket_strerror
(socket_last_error()) . \n;
}
$bnd =  socket_bind ( $socket, $PHPDG_TMP,$service_port);
$len = strlen($str);
$retval = socket_sendto ($socket, $str, $len, 0, $PHPDG_PATH,
$service_port);
if ($retval == FALSE)
{
   echo \nsocket_sendto() failed.\nReason:  . socket_strerror
(socket_last_error()) . \n;
}
$succ = socket_recvfrom ($socket, $buff,5,0,
$address1,$service_port1); // here i am waiting for response from server,but
i am unable to get response .What might be the problem.
socket_close ($socket);
unlink(/var/php.xx);
?

Server side.
In the server after receiving the message.I am giving the response to client
using sendto() method.

Can some one help me how to over come the problem over here.

regards
Amarnath R

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



[PHP] Re: quick i need some help please

2003-10-01 Thread PAUL FERRIE
False alarm !

Paul Ferrie [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 i have a admin section for a new site that i have built, to cut a long
story
 short
 the submit form adds news stories to the site.  For some reason behound me
 the php script is converting  to a square.
 It is a flash based admin area not yet sure if this is an issuse, i just
got
 the call :(
 the font being used is a system defult font (arial).

 thanks
 Paul

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



[PHP] regex/preg_replace() difficulty

2003-10-01 Thread jonas_weber
Regular Expressions: How can I indicate that the contents of a term 
(user input*) needs to be treated as 'non-operators/control characters' 
(as *word* to match in that exact way)?
(* Because the term is a user's input I can't escape the control 
characters manually.)

Example:
$result = 
preg_replace('/('.$termWithOptionalBold.')(\/?span[^]*)*()/si', 
'span class=highlight\1/span', $result);

[If $termWithOptionalBold is a . (period) for example, any char will 
be matched--instead of only the .]

Any suggestions?

Thanks a lot for your effort!
Best wishes,
jonas
PS: Somewhere I read that '\Q' would do something like that but it 
didn't work.

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


RE: [PHP] removing an element from an array

2003-10-01 Thread Ford, Mike [LSS]
On 01 October 2003 11:25, Angelo Zanetti contributed these pearls of wisdom:

 Hi
 
 If I have an array and want to remove and element from this
 array. correct me if this is the wrong approach:

It's the wrong approach ;)
 
 create a temporary array with 1 element less than the
 origional array, get the position of the element ( is there a
 function for this?) and then run through the origional array
 copying all elements besides the element which is meant to be
 removed. 
 
 Is there no function to do this? It seems like alot of
 overhead to do this process, especially if the array is big.
 comments? 

unset($array[$key]);

Cheers!

Mike

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

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



Re: [PHP] CURL + https

2003-10-01 Thread Marek Kilimajer
Did you compile php with openssl support?

Yonatan Ben-Nes wrote:

Hi,

I'm currently building an e-commerce site and I need to create the connection between 
the site and the server which validate the credit card.
I'm trying to do it with CURL which will post all the information from a secured page 
(https) to another secure page, the code that i succeded to create so far is able to 
send from one secured page to another at my server but from some reason isnt able to 
connect to the cc server, when i tried to use curl through the shell i succeded to 
connect.
The code that im trying is (i reduced the amount of variables for the snippet):
 $OrderID = OrderID=.$OrderID.;
 $total = total=.$total.;
 $URL = URL=http://www.curtaincallproductions.com/ccall08/html/order/auth.phtml;;
 $email = email=.$b_email.;
 $Cardnum1 = Cardnum1=.$Cardnum[1].; 
 $Cardnum2 = Cardnum2=.$Cardnum[2].; 
 $Cardnum3 = Cardnum3=.$Cardnum[3].; 
 $Cardnum4 = Cardnum4=.$Cardnum[4].; 
 $Cardname = Cardname=.$Cardname; 
 
 $params = $OrderID.$total.$URL.$email.$Cardnum1.$Cardnum2.$Cardnum3.$Cardnum4.$Cardname;
 $params = str_replace( , %20, $params);
 $user_agent = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0);

 $ch = curl_init('https://www.goemerchant7.com/cgi-bin/gateway/direct.cgi');
 curl_setopt($ch, CURLOPT_POST, 1); // make a regular post
 curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
 curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); //user-agent header to be used 
 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); 
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

 $result = curl_exec ($ch);
 curl_close ($ch);
 }
Anyone know what can be the problem?
I also know that if i just create a static form which post to the cc server the cc 
return me an error, with curl i cant know what is the error... or can i?
Thanks Alot in advance,
--
My friends are worth gold to me, so I prefer to sell them and get rich!
Ben-Nes Yonatan
Canaan Surfing Ltd
Tel: 972-4-6991122
Fax: 972-4-6990098
http://sites.canaan.co.il
--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] removing an element from an array

2003-10-01 Thread Angelo Zanetti
isnt the unset function not a safe function to use  was discontinued, i
think thats why its not in the manual.


-Original Message-
From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 12:58 PM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP] removing an element from an array


On 01 October 2003 11:25, Angelo Zanetti contributed these pearls of wisdom:

 Hi

 If I have an array and want to remove and element from this
 array. correct me if this is the wrong approach:

It's the wrong approach ;)

 create a temporary array with 1 element less than the
 origional array, get the position of the element ( is there a
 function for this?) and then run through the origional array
 copying all elements besides the element which is meant to be
 removed.

 Is there no function to do this? It seems like alot of
 overhead to do this process, especially if the array is big.
 comments?

unset($array[$key]);

Cheers!

Mike

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

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

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



RE: [PHP] removing an element from an array

2003-10-01 Thread Daniel Perez Clavero
Angelo,
Given array1 extract array2 from there, and put it into $array_result.

$array2[0]=Value to extract;
$array_result = array_diff ($array1, $array2);

Should work.
Rgrds.

-Original Message-
From: Angelo Zanetti [mailto:[EMAIL PROTECTED]
Sent: miércoles, 01 de octubre de 2003 12:25
To: [EMAIL PROTECTED]
Subject: [PHP] removing an element from an array


Hi

If I have an array and want to remove and element from this array. correct
me if this is the wrong approach:

create a temporary array with 1 element less than the origional array, get
the position of the element ( is there a function for this?) and then run
through the origional array copying all elements besides the element which
is meant to be removed.

Is there no function to do this? It seems like alot of overhead to do this
process, especially if the array is big. comments?

Angelo

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

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



Re: [PHP] CURL + https

2003-10-01 Thread Yonatan Ben-Nes
well when i try to work with curl through the shell it work fine without any
problems more then that when i use the curl with php at my server to
another page at my server its working fine also, just when i try to use it
through php it make the problems so i think that its installed, or i
mistake?

- Original Message - 
From: Marek Kilimajer [EMAIL PROTECTED]
To: Yonatan Ben-Nes [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 1:04 PM
Subject: Re: [PHP] CURL + https


 Did you compile php with openssl support?

 Yonatan Ben-Nes wrote:

  Hi,
 
  I'm currently building an e-commerce site and I need to create the
connection between the site and the server which validate the credit card.
  I'm trying to do it with CURL which will post all the information from a
secured page (https) to another secure page, the code that i succeded to
create so far is able to send from one secured page to another at my server
but from some reason isnt able to connect to the cc server, when i tried to
use curl through the shell i succeded to connect.
 
  The code that im trying is (i reduced the amount of variables for the
snippet):
   $OrderID = OrderID=.$OrderID.;
   $total = total=.$total.;
   $URL =
URL=http://www.curtaincallproductions.com/ccall08/html/order/auth.phtml;;
   $email = email=.$b_email.;
   $Cardnum1 = Cardnum1=.$Cardnum[1].;
   $Cardnum2 = Cardnum2=.$Cardnum[2].;
   $Cardnum3 = Cardnum3=.$Cardnum[3].;
   $Cardnum4 = Cardnum4=.$Cardnum[4].;
   $Cardname = Cardname=.$Cardname;
 
   $params =
$OrderID.$total.$URL.$email.$Cardnum1.$Cardnum2.$Cardnum3.$Cardnum4.$Cardnam
e;
   $params = str_replace( , %20, $params);
   $user_agent = Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0);
 
   $ch =
curl_init('https://www.goemerchant7.com/cgi-bin/gateway/direct.cgi');
   curl_setopt($ch, CURLOPT_POST, 1); // make a regular post
   curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
   curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); //user-agent header
to be used
   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
   curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
 
   $result = curl_exec ($ch);
   curl_close ($ch);
   }
 
  Anyone know what can be the problem?
  I also know that if i just create a static form which post to the cc
server the cc return me an error, with curl i cant know what is the error...
or can i?
 
  Thanks Alot in advance,
  --
  My friends are worth gold to me, so I prefer to sell them and get
rich!
 
  Ben-Nes Yonatan
  Canaan Surfing Ltd
  Tel: 972-4-6991122
  Fax: 972-4-6990098
  http://sites.canaan.co.il
  --

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



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



[PHP] Re: removing an element from an array

2003-10-01 Thread Dennis Sterzenbach
 Is there no function to do this? It seems like alot of overhead to do
this
 process, especially if the array is big. comments?

Not if you do not create another array, which in my oppinion
is totally unnecessary.

I always did the following after finding the position from
where to strip off the element:

for ($i=$elpos; $icount($array); $i++) {
$array[$i] = $array[$i+1];
}
unset($array[count($array)-1]);

--
 Dennis Sterzenbach
 www.darknoise.de

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



Re: [PHP] removing an element from an array

2003-10-01 Thread Dennis Sterzenbach
Angelo Zanetti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 isnt the unset function not a safe function to use  was discontinued,
i
 think thats why its not in the manual.

Hi Angelo,

look at the examples on
http://www.php.net/manual/en/function.unset.php
And you know that it is also used for purpose of deleting some
element from an array at some key.

--
 Dennis Sterzenbach
 www.darknoise.de

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



Re: [PHP] regex/preg_replace() difficulty

2003-10-01 Thread Marek Kilimajer
You can escape the control characters manualy ;)

$termWithOptionalBold=str_replace(array('.','\','$' 
),array('\.','\\','\$' ), $termWithOptionalBold);

[EMAIL PROTECTED] wrote:

Regular Expressions: How can I indicate that the contents of a term 
(user input*) needs to be treated as 'non-operators/control characters' 
(as *word* to match in that exact way)?
(* Because the term is a user's input I can't escape the control 
characters manually.)

Example:
$result = 
preg_replace('/('.$termWithOptionalBold.')(\/?span[^]*)*()/si', 
'span class=highlight\1/span', $result);

[If $termWithOptionalBold is a . (period) for example, any char will 
be matched--instead of only the .]

Any suggestions?

Thanks a lot for your effort!
Best wishes,
jonas
PS: Somewhere I read that '\Q' would do something like that but it 
didn't work.

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


[PHP] PHP_OFFSET_CAPTURE

2003-10-01 Thread Joerg H. Baach
Hi,

I have this litte tiny test-script test.php:

?
$var= preg_match_all(|a(b)+|,abbabbabbaa,$hits, PREG_OFFSET_CAPTURE);
print '$var: ';
print_r($var);
?

I would asume that $var would be an array, containing the offsets of the
found matches. Instead it is just a simple integer containing the number
of matches. Pretty much looks like preg_match_all is not returning the
right thing.

[EMAIL PROTECTED] regex]$ php test.php 
$var: 3

[EMAIL PROTECTED] regex]$ php -v
PHP 4.3.3 (cli) (built: Sep 26 2003 19:58:02)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

Is it just me, or is it a bug? 

Thanks a lot,

  Joerg

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



Re: [PHP] removing an element from an array

2003-10-01 Thread Dennis Sterzenbach
Daniel Perez Clavero [EMAIL PROTECTED] wrote in
message
news:[EMAIL PROTECTED]
 Angelo,
 Given array1 extract array2 from there, and put it into $array_result.

 $array2[0]=Value to extract;
 $array_result = array_diff ($array1, $array2);

 Should work.
 Rgrds.

Well this only returns the differences between $array1 and $array2.
But it doesn't touch/change the arrays themselves.

--
 Dennis Sterzenbach
 www.darknoise.de

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



[PHP] Re: regex/preg_replace() difficulty

2003-10-01 Thread Jon Kriek
You need to escape the period . twice with backslashes \\

-- 
Jon Kriek
http://phpfreaks.com

Jonas_weber @ Gmx . Ch [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Regular Expressions: How can I indicate that the contents of a term
 (user input*) needs to be treated as 'non-operators/control characters'
 (as *word* to match in that exact way)?
 (* Because the term is a user's input I can't escape the control
 characters manually.)

 Example:
 $result =
preg_replace('/('.$termWithOptionalBold.')(\/?span[^]*)*()/si', 'span
class=highlight\1/span', $result);

 [If $termWithOptionalBold is a . (period) for example, any char will
 be matched--instead of only the .]

 Any suggestions?


 Thanks a lot for your effort!
 Best wishes,
 jonas


 PS: Somewhere I read that '\Q' would do something like that but it
 didn't work.

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



[PHP] RE: removing an element from an array

2003-10-01 Thread Christoffer Enedahl
Look up array_splice in the manual
HTH/Christoffer

[PHP] Re: removing an element from an array

2003-10-01 Thread Dennis Sterzenbach
 for ($i=$elpos; $icount($array); $i++) {
 $array[$i] = $array[$i+1];
 }
 unset($array[count($array)-1]);


I found another possible solution, which should be more
performant than the one above:

$input = array (a, b, c, d, e);
print_r($input);
$offset = 2;
$array1 = array_splice($input, 0, $offset);
$array2 = array_splice($input, $offset-1);
$input = array_merge($array1, $array2);
print_r($input);

Results in output of:
Array ( [0] = a [1] = b [2] = c [3] = d [4] = e )
Array ( [0] = a [1] = b [2] = d [3] = e )

--
 Dennis Sterzenbach
 www.darknoise.de

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



Re: [PHP] PHP_OFFSET_CAPTURE

2003-10-01 Thread Marek Kilimajer
Documentation is little unclear about this, by return means the third 
argument. Try print_r($hits);

Joerg H. Baach wrote:

Hi,

I have this litte tiny test-script test.php:

?
$var= preg_match_all(|a(b)+|,abbabbabbaa,$hits, PREG_OFFSET_CAPTURE);
print '$var: ';
print_r($var);
?
I would asume that $var would be an array, containing the offsets of the
found matches. Instead it is just a simple integer containing the number
of matches. Pretty much looks like preg_match_all is not returning the
right thing.
[EMAIL PROTECTED] regex]$ php test.php 
$var: 3

[EMAIL PROTECTED] regex]$ php -v
PHP 4.3.3 (cli) (built: Sep 26 2003 19:58:02)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
Is it just me, or is it a bug? 

Thanks a lot,

  Joerg

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


RE: [PHP] removing an element from an array

2003-10-01 Thread Daniel Perez Clavero
Copy/Paste to a php file, and observe how it works. Maybe could be usefull
for u

?

$array1[0]=Red;
$array1[1]=Blue;
$array1[2]=White;
$array1[3]=Black;

$array2[0]=Blue;
$array2[1]=Black;

$array1_result_diff=array_diff($array1, $array2);

echo This is an array with colors not starting with B\B\/B;
echo BR;
echo var_dump($array1_result_diff);
echo BR;
echo BR;
echo BR;

$array2_result_diff=array_intersect($array1, $array2);
echo This is an array with colors starting with B\B\/B;
echo BR;
echo var_dump($array2_result_diff);
?



-Original Message-
From: Angelo Zanetti [mailto:[EMAIL PROTECTED]
Sent: miércoles, 01 de octubre de 2003 12:25
To: [EMAIL PROTECTED]
Subject: [PHP] removing an element from an array


Hi

If I have an array and want to remove and element from this array. correct
me if this is the wrong approach:

create a temporary array with 1 element less than the origional array, get
the position of the element ( is there a function for this?) and then run
through the origional array copying all elements besides the element which
is meant to be removed.

Is there no function to do this? It seems like alot of overhead to do this
process, especially if the array is big. comments?

Angelo

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

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



Re: [PHP] PHP_OFFSET_CAPTURE

2003-10-01 Thread Jason Wong
On Wednesday 01 October 2003 18:34, Joerg H. Baach wrote:

 ?
 $var= preg_match_all(|a(b)+|,abbabbabbaa,$hits, PREG_OFFSET_CAPTURE);
 print '$var: ';
 print_r($var);
 ?

 I would asume that $var would be an array, containing the offsets of the
 found matches. Instead it is just a simple integer containing the number
 of matches. Pretty much looks like preg_match_all is not returning the
 right thing.

[snip]

 Is it just me, or is it a bug?

Probably you! RTFM again.

  print_r($hits);

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I wonder if I ought to tell them about my PREVIOUS LIFE as a COMPLETE
STRANGER?
*/

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



RE: [PHP] Re: removing an element from an array

2003-10-01 Thread Angelo Zanetti
how do I find the position of the element in the array? based on the value
that is passed? if there a funtion for this or do I manually have to get
this value?

-Original Message-
From: Dennis Sterzenbach [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 1:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: removing an element from an array


 Is there no function to do this? It seems like alot of overhead to do
this
 process, especially if the array is big. comments?

Not if you do not create another array, which in my oppinion
is totally unnecessary.

I always did the following after finding the position from
where to strip off the element:

for ($i=$elpos; $icount($array); $i++) {
$array[$i] = $array[$i+1];
}
unset($array[count($array)-1]);

--
 Dennis Sterzenbach
 www.darknoise.de

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



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



Re: [PHP] Re: removing an element from an array

2003-10-01 Thread Dennis Sterzenbach
Angelo Zanetti [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 how do I find the position of the element in the array? based on the
value
 that is passed? if there a funtion for this or do I manually have to
get
 this value?


$key = array_search(value-to-search);

--
 Dennis Sterzenbach
 www.darknoise.de

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



Re: [PHP] Attempt at putting greedy htmlspecialchars on a diet

2003-10-01 Thread CPT John W. Holmes
From: Eugene Lee [EMAIL PROTECTED]

 On Wed, Oct 01, 2003 at 01:12:16AM -0400, Gerard Samuel wrote:
 :
 : Got a problem with htmlspecialchars being too greedy, where
 : for example, it converts
 : foo;
 : to
 : amp;foo;
 :
 : Yes it displays correctly in the browser for some content, but not all.
 : (an example is posted below)
 : So I came up with this example code, but not sure if there is an
 : easier/better way to get the correct end result.
 : If there is a better way, feel free to let me know.
 : Thanks
 :
 : Note: I dont read/speak chinese, so if its offensive please forgive me.
 :
 : --
 : ?php
 :
 : $foo = '#20013;#25991;  http://www.foo.com/index.php?foo=1bar=2';

 The problem isn't with htmlspecialchars().  It doesn't know what parts
 of the string are HTML character references and which parts are not.
 But if you're willing to dig up the numeric character references for
 those specific Chinese characters, then split the string into the part
 that needs no translation and the part that needs it.  That is:

 $foo1encoded = '#20013;#25991;'
 $foo2raw = '  http://www.foo.com/index.php?foo=1bar=2';
 $foo = $foo1 . htmlspecialchars(foo2raw);

Maybe you should run html_entity_decode() on the string first, then run
encode again. The decode will take #20013; and turn it into it's actual
character but not affect anything else. Then the recoding will turn it back
into #20013; and also encode any other characters.

---John Holmes...

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



RE: [PHP] removing an element from an array

2003-10-01 Thread Daniel Perez Clavero
I know but was just a sample, try to use $array1 instead of $array_result.
Note: keys remain the same.

$array2[0]=Value to extract;
$array1 = array_diff ($array1, $array2);

-Original Message-
From: Dennis Sterzenbach [mailto:[EMAIL PROTECTED]
Sent: miércoles, 01 de octubre de 2003 13:24
To: [EMAIL PROTECTED]
Subject: Re: [PHP] removing an element from an array


Daniel Perez Clavero [EMAIL PROTECTED] wrote in
message
news:[EMAIL PROTECTED]
 Angelo,
 Given array1 extract array2 from there, and put it into $array_result.

 $array2[0]=Value to extract;
 $array_result = array_diff ($array1, $array2);

 Should work.
 Rgrds.

Well this only returns the differences between $array1 and $array2.
But it doesn't touch/change the arrays themselves.

--
 Dennis Sterzenbach
 www.darknoise.de

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

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



Re: [PHP] regex/preg_replace() difficulty

2003-10-01 Thread CPT John W. Holmes
From: [EMAIL PROTECTED]

 Regular Expressions: How can I indicate that the contents of a term 
 (user input*) needs to be treated as 'non-operators/control characters' 
 (as *word* to match in that exact way)?
 (* Because the term is a user's input I can't escape the control 
 characters manually.)
 
 Example:
 $result = 
 preg_replace('/('.$termWithOptionalBold.')(\/?span[^]*)*()/si', 
 'span class=highlight\1/span', $result);
 
 [If $termWithOptionalBold is a . (period) for example, any char will 
 be matched--instead of only the .]
 
 Any suggestions?

I got one!

http://www.php.net/manual/en/function.preg-quote.php

---John Holmes...

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



[PHP] Date Sorting

2003-10-01 Thread Greg Wiley
Apologies if this has been asked before but I couldn't find
anything on google or any of the PHP code sites that quite fits my
requirements. Here's the problem:

I have a form which presents the user with a table of dates with
checkboxes for a three month period, e.g.

Dec 7th 14th21st28th
am  [ ] [ ] [ ] [ ]
pm  [ ] [ ] [ ] [ ]

Jan 4th 11th18th25th
am  [ ] [ ] [ ] [ ]
pm  [ ] [ ] [ ] [ ]

Feb 1st 8th 15th22nd29th
am  [ ] [ ] [ ] [ ] [ ]
pm  [ ] [ ] [ ] [ ] [ ]

When the user submits the form with any of the boxes checked I
want to have these sorted into date order.

If I check Dec 28th am and pm, Jan 4th am and pm, Jan 18th am and
pm and Feb 15th am and pm then the order returned in the _POST is:

Dec 28 am, Dec 28 pm, Jan 4 am, Jan 18 am, Jan 4 pm, Jan 18 pm,
Feb 15 am, Feb 15 pm

This is, I believe, due to the order of the elements in the form.
I tried using tabindex to influence the order returned but to no
avail. So I'm now trying to do this in the php code that processes
the submission. There is no year info such that I could turn the
dates into timestamp and sort that way. Has anyone got any code
that can sort this correctly?

Cheers, Greg.
-- 
Greg Wiley
http://wileysworld.org/ 

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



[PHP] Installing Php with Apache on Solaris

2003-10-01 Thread Donahue, Peter

I want to build Php(4.3.3) for Apache(1.3.28) on Solaris 8.
I am configuring Php with oci8 (Oracle) support.

Is it possible to build Php on system A, and then move the
files over to another Solaris 8 system and expect it to function
properly? I expect there to be a problem with the ORACLE_HOME
path, if it's not the same on the second system. But I believe I should
be able to solve that by 'export'ing ORACLE_HOME in the
apachectl file.

What I'm trying to do is build Apache and Php so that I can ship them
and install them along with my product.

Thanks for any help

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



[PHP] exec command

2003-10-01 Thread nabil
hi all;

I want to execute
#useradd -d /home/all -g wahtever -s /bin/bash newuser

how can I do it ... I used exec and shell_exec and system
I tried all the following but with no hope

exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die ('not
done');
exec('/usr/sbin/useradd -d /home/all -g wahtever -s /bin/bash newuser') or
die ('not done');
shell_exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die
('not done');

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



Re: [PHP] Installing Php with Apache on Solaris

2003-10-01 Thread Ray Hunter
What you would want to do is build apache + php together with all the
libraries built into it. Unless you want the user to install the
libraries seperate. I have done this in the past however, you file is
going to be HUGE. 

Basically you have a file with everything that it needs in it and does
not use any system libraries.

As for your questions: yes you can do it.

--
Ray


On Wed, 2003-10-01 at 07:58, Donahue, Peter wrote:
 I want to build Php(4.3.3) for Apache(1.3.28) on Solaris 8.
 I am configuring Php with oci8 (Oracle) support.
 
 Is it possible to build Php on system A, and then move the
 files over to another Solaris 8 system and expect it to function
 properly? I expect there to be a problem with the ORACLE_HOME
 path, if it's not the same on the second system. But I believe I should
 be able to solve that by 'export'ing ORACLE_HOME in the
 apachectl file.
 
 What I'm trying to do is build Apache and Php so that I can ship them
 and install them along with my product.
 
 Thanks for any help

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



Re: [PHP] exec command

2003-10-01 Thread Ray Hunter
 I want to execute
 #useradd -d /home/all -g wahtever -s /bin/bash newuser

You have to be root to add a user to the system...and just a heads
up...you might want to rethink doing this from apache or php.  The
security implications alone make me cringe.

--
Ray

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



RE: [PHP] exec command

2003-10-01 Thread Javier Tacon

From CLI or Web?

You must have in mind that useradd only can be executed by root user.



-Mensaje original-
De: nabil [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 01 de octubre de 2003 16:05
Para: [EMAIL PROTECTED]
Asunto: [PHP] exec command
Importancia: Baja


hi all;

I want to execute
#useradd -d /home/all -g wahtever -s /bin/bash newuser

how can I do it ... I used exec and shell_exec and system
I tried all the following but with no hope

exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die ('not
done');
exec('/usr/sbin/useradd -d /home/all -g wahtever -s /bin/bash newuser') or
die ('not done');
shell_exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die
('not done');

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

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



[PHP] Re: exec command

2003-10-01 Thread Gal
How do you run this ? Which user ?

if its done via Apache - you can't run useradd with the apache user name.
if you run it from command line make sure you are root.
Nabil wrote:
hi all;

I want to execute
#useradd -d /home/all -g wahtever -s /bin/bash newuser
how can I do it ... I used exec and shell_exec and system
I tried all the following but with no hope
exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die ('not
done');
exec('/usr/sbin/useradd -d /home/all -g wahtever -s /bin/bash newuser') or
die ('not done');
shell_exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die
('not done');
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Date Sorting

2003-10-01 Thread Ray Hunter
Try using any of the sort functions:

sort
asort
arsort
ksort
krsort 
...

That should get you started. 

--
Ray

On Wed, 2003-10-01 at 07:18, Greg Wiley wrote:
 Apologies if this has been asked before but I couldn't find
 anything on google or any of the PHP code sites that quite fits my
 requirements. Here's the problem:
 
 I have a form which presents the user with a table of dates with
 checkboxes for a three month period, e.g.
 
 Dec   7th 14th21st28th
   am  [ ] [ ] [ ] [ ]
   pm  [ ] [ ] [ ] [ ]
 
 Jan   4th 11th18th25th
   am  [ ] [ ] [ ] [ ]
   pm  [ ] [ ] [ ] [ ]
 
 Feb   1st 8th 15th22nd29th
   am  [ ] [ ] [ ] [ ] [ ]
   pm  [ ] [ ] [ ] [ ] [ ]
 
 When the user submits the form with any of the boxes checked I
 want to have these sorted into date order.
 
 If I check Dec 28th am and pm, Jan 4th am and pm, Jan 18th am and
 pm and Feb 15th am and pm then the order returned in the _POST is:
 
 Dec 28 am, Dec 28 pm, Jan 4 am, Jan 18 am, Jan 4 pm, Jan 18 pm,
 Feb 15 am, Feb 15 pm
 
 This is, I believe, due to the order of the elements in the form.
 I tried using tabindex to influence the order returned but to no
 avail. So I'm now trying to do this in the php code that processes
 the submission. There is no year info such that I could turn the
 dates into timestamp and sort that way. Has anyone got any code
 that can sort this correctly?
 
 Cheers, Greg.
 -- 
 Greg Wiley
 http://wileysworld.org/

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



RE: [PHP] exec command

2003-10-01 Thread Javier Tacon

eheh, yes, very dangerous, imagine that one user put this on username form field

; echo root:x:0:0:root:/root:/bin/bash  /etc/passwd

or things like that :)


-Mensaje original-
De: Ray Hunter [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 01 de octubre de 2003 16:06
Para: nabil
CC: [EMAIL PROTECTED]
Asunto: Re: [PHP] exec command
Importancia: Baja


 I want to execute
 #useradd -d /home/all -g wahtever -s /bin/bash newuser

You have to be root to add a user to the system...and just a heads
up...you might want to rethink doing this from apache or php.  The
security implications alone make me cringe.

--
Ray

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

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



Re: [PHP] Date Sorting

2003-10-01 Thread Jason Wong
On Wednesday 01 October 2003 21:18, Greg Wiley wrote:
 Apologies if this has been asked before but I couldn't find
 anything on google or any of the PHP code sites that quite fits my
 requirements. Here's the problem:

 I have a form which presents the user with a table of dates with
 checkboxes for a three month period, e.g.

 Dec   7th 14th21st28th
   am  [ ] [ ] [ ] [ ]
   pm  [ ] [ ] [ ] [ ]

 Jan   4th 11th18th25th
   am  [ ] [ ] [ ] [ ]
   pm  [ ] [ ] [ ] [ ]

 Feb   1st 8th 15th22nd29th
   am  [ ] [ ] [ ] [ ] [ ]
   pm  [ ] [ ] [ ] [ ] [ ]

 When the user submits the form with any of the boxes checked I
 want to have these sorted into date order.

 If I check Dec 28th am and pm, Jan 4th am and pm, Jan 18th am and
 pm and Feb 15th am and pm then the order returned in the _POST is:

 Dec 28 am, Dec 28 pm, Jan 4 am, Jan 18 am, Jan 4 pm, Jan 18 pm,
 Feb 15 am, Feb 15 pm

 This is, I believe, due to the order of the elements in the form.
 I tried using tabindex to influence the order returned but to no
 avail. So I'm now trying to do this in the php code that processes
 the submission. There is no year info such that I could turn the
 dates into timestamp and sort that way. Has anyone got any code
 that can sort this correctly?

Incorporate whatever sorting info you need into the value of the checkbox.

  input type=checkbox 
 name=Dec 28 am 
 value=insert timestamp for Dec 28 or whatever

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
leverage, n.:
Even if someone doesn't care what the world thinks
about them, they always hope their mother doesn't find out.
*/

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



Re: [PHP] exec command

2003-10-01 Thread Marek Kilimajer
You can use sudo (man sudo), but keep in mind security!!!

nabil wrote:
hi all;

I want to execute
#useradd -d /home/all -g wahtever -s /bin/bash newuser
how can I do it ... I used exec and shell_exec and system
I tried all the following but with no hope
exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die ('not
done');
exec('/usr/sbin/useradd -d /home/all -g wahtever -s /bin/bash newuser') or
die ('not done');
shell_exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die
('not done');
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Installing Php with Apache on Solaris

2003-10-01 Thread Ray Hunter
You build apache with php statically linked instead of dynamically
linked.

Check the apache documentation on statically linking apache and php
(module).

I would venture to say that oracle libraries should not be shipped. They
are proprietary code and the user needs to install them. Your oracle
libraries should be installed by the user. However, I would suggest
checking with oracle on this.

--
Ray


On Wed, 2003-10-01 at 08:12, Donahue, Peter wrote:
 How would I build them with all of the libraries?
 Also - is it OK for me to ship Oracle libraries to
 customers to install on a system that may not have
 Oracle installed (tho they must have an Oracle server
 installed somewhere in their network for the product
 to actually do anything).
 
 Thanks,
 
 What you would want to do is build apache + php together with all the
 libraries built into it. Unless you want the user to install the
 libraries seperate. I have done this in the past however, you file is
 going to be HUGE. 
 
 Basically you have a file with everything that it needs in it and does
 not use any system libraries.
 
 As for your questions: yes you can do it.
 
 --
 Ray
 
 
  I want to build Php(4.3.3) for Apache(1.3.28) on Solaris 8.
  I am configuring Php with oci8 (Oracle) support.
  
  Is it possible to build Php on system A, and then move the
  files over to another Solaris 8 system and expect it to function
  properly? I expect there to be a problem with the ORACLE_HOME
  path, if it's not the same on the second system. But I believe I should
  be able to solve that by 'export'ing ORACLE_HOME in the
  apachectl file.
  
  What I'm trying to do is build Apache and Php so that I can ship them
  and install them along with my product.
  
  Thanks for any help
 
 

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



[PHP] Mail.php help

2003-10-01 Thread Eric Rounds
I have tried numorous email form tutorials, and all have not sent to the recipient. I 
don't know what is wrong. How do I check to see that sendmail is installed on PHP on 
Apache? The form goes through. I can pass variables and echo or print them, but I just 
can't seem to get it to send the message to the email I set up as the recipient...

My globals are turned ON on my php.ini file.

Using php 4.2

Any help is greatly appreciated!

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



RE: [PHP] Date Sorting

2003-10-01 Thread Greg Wiley
 -Original Message-
 From: Jason Wong [mailto:[EMAIL PROTECTED] 
[problem snipped]
 
 Incorporate whatever sorting info you need into the value of 
 the checkbox.
 
   input type=checkbox 
  name=Dec 28 am 
  value=insert timestamp for Dec 28 or whatever
 

Thanks, someone else suggested this and I think this is the method
I shall use.

Cheers, Greg.

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



Re: [PHP] Mail.php help

2003-10-01 Thread Marek Kilimajer
Mentioning your operating system would be helpfull. But try to set SMTP 
setting in php.ini to your provider's smtp server.

Eric Rounds wrote:

I have tried numorous email form tutorials, and all have not sent to the recipient. I don't know what is wrong. How do I check to see that sendmail is installed on PHP on Apache? The form goes through. I can pass variables and echo or print them, but I just can't seem to get it to send the message to the email I set up as the recipient...

My globals are turned ON on my php.ini file.

Using php 4.2

Any help is greatly appreciated!

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


Re: [PHP] Mail.php help

2003-10-01 Thread Jason Wong
On Wednesday 01 October 2003 22:51, Eric Rounds wrote:
 I have tried numorous email form tutorials, and all have not sent to the
 recipient. I don't know what is wrong. How do I check to see that sendmail
 is installed on PHP on Apache? The form goes through. I can pass variables
 and echo or print them, but I just can't seem to get it to send the message
 to the email I set up as the recipient...

 My globals are turned ON on my php.ini file.

 Using php 4.2

 Any help is greatly appreciated!

Check that the mail related settings in php.ini are correct.

What OS is your server running?

A quick way to check whether mail is configured correctly is to use the mail 
option of error_log().

If all else fails try one of the classes in www.phpclasses.org, it bypasses 
php builtin mail() command.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Law of Continuity:
Experiments should be reproducible.  They should all fail the same way.
*/

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



[PHP] how to call a script every (say) 5 minutes

2003-10-01 Thread Jan Hübbers
Hi all,
can someone point me to a quickstart to the
following problem?

I'd like the OS to call a Script every (say) 5 minutes, that does some
time comparisons (like: hey, you ought to see your customer
in one hour or the like) on some database thingy.

Basically i'm just interested in how to perform a script every
given amount of time under Windows (2k, XP) and Linux.

I don't know to much about cron jobs or the windows scripting
host, but i thought something along the line might work out.

thanks in advance
Jan

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



RE: [PHP] how to call a script every (say) 5 minutes

2003-10-01 Thread Jay Blanchard
[snip]
I don't know to much about cron jobs or the windows scripting
host, but i thought something along the line might work out.
[/snip]

You have pretty much answered your own question

CRON for nix
Task Scheduler fo ms

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



Re: [PHP] how to call a script every (say) 5 minutes

2003-10-01 Thread Ray Hunter
On linux do run the following commands:

$ man cron
$ man crontab
$ man 5 crontab

That should get you started with cron on linux...

HTH,

Ray


On Wed, 2003-10-01 at 08:53, Jan Hübbers wrote:
 Hi all,
 can someone point me to a quickstart to the
 following problem?
 
 I'd like the OS to call a Script every (say) 5 minutes, that does some
 time comparisons (like: hey, you ought to see your customer
 in one hour or the like) on some database thingy.
 
 Basically i'm just interested in how to perform a script every
 given amount of time under Windows (2k, XP) and Linux.
 
 I don't know to much about cron jobs or the windows scripting
 host, but i thought something along the line might work out.
 
 thanks in advance
 Jan

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



Re: [PHP] Mail.php help

2003-10-01 Thread Eric Rounds
We have PHP 4.2 installed on Mac OS X under Apache.

The settings in the php.ini file are:

sendmail_from - [EMAIL PROTECTED]
sendmail_path - /usr/sbin/sendmail -t -i 
SMTP - localhost
smtp_port - 25

A quick way to check whether mail is configured correctly is to use the mail 
option of error_log().

How do I do this? Set up an echo on my form page?

?
echo mail error_log();
?

???

Thank you all for your help.

On Wednesday 01 October 2003 22:51, Eric Rounds wrote:
 I have tried numorous email form tutorials, and all have not sent to the
 recipient. I don't know what is wrong. How do I check to see that sendmail
 is installed on PHP on Apache? The form goes through. I can pass variables
 and echo or print them, but I just can't seem to get it to send the message
 to the email I set up as the recipient...

 My globals are turned ON on my php.ini file.

 Using php 4.2

 Any help is greatly appreciated!

Check that the mail related settings in php.ini are correct.

What OS is your server running?

A quick way to check whether mail is configured correctly is to use the mail 
option of error_log().

If all else fails try one of the classes in www.phpclasses.org, it bypasses 
php builtin mail() command.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Law of Continuity:
   Experiments should be reproducible.  They should all fail the same way.
*/

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



 

Eric Rounds

studio - 215.297.5429
cell - 215.431.2313

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



[PHP] (another) regex difficulty

2003-10-01 Thread jonas_weber
regular expressions
the example below should turn any character exept \* (*= any char) 
into an x:

$term = preg_replace('/[^(\\\)+(.){1}]/', 'x', $term);

but i guess because of the [brackets] the . (period) is treated as 
character . instead as metacharacter (that matches any char).

anyone knows how to work around this?

thanks for your effort
best wishes,
jns
ps: thanks for your help, holmes and kilimajer!

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


RE: [PHP] Date Sorting

2003-10-01 Thread Greg Wiley
 -Original Message-
 From: Greg Wiley [mailto:[EMAIL PROTECTED] 
 
  -Original Message-
  From: Jason Wong [mailto:[EMAIL PROTECTED]
 [problem snipped]
  
  Incorporate whatever sorting info you need into the value of
the 
  checkbox.
  
input type=checkbox 
   name=Dec 28 am 
   value=insert timestamp for Dec 28 or whatever
  
 
 Thanks, someone else suggested this and I think this is the 
 method I shall use.
 
And this was the method that worked! Thanks for all those who took
the trouble to respond you've helped fixed a problem that's been
bugging me for a couple of days.

Cheers, Greg.
-- 
Greg Wiley
http://wileysworld.org/ 

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



Re: [PHP] Mail.php help

2003-10-01 Thread Eugene Lee
On Wed, Oct 01, 2003 at 08:18:21AM -0700, Eric Rounds wrote:
: 
: We have PHP 4.2 installed on Mac OS X under Apache.
: 
: The settings in the php.ini file are:
: 
: sendmail_from - [EMAIL PROTECTED]
: sendmail_path - /usr/sbin/sendmail -t -i 
: SMTP - localhost
: smtp_port - 25

Make sure that Sendmail is enabled and running on OS X.  By default,
Sendmail is disabled on OS X.

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



Re: [PHP] Mail.php help

2003-10-01 Thread Eric Rounds
Thank you! I will let the administrator know.


By the way, is there a way I can check, without looking into the serving Mac, to see 
if it is running?

Thanks again

 
On Wednesday, October 01, 2003, at 08:26AM, Eugene Lee [EMAIL PROTECTED] wrote:

Make sure that Sendmail is enabled and running on OS X.  By default,
Sendmail is disabled on OS X.

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



[PHP] Oracle 8i - PEAR - Problem

2003-10-01 Thread orlandopozo
Hello, I have been trouble about to connect Oracle 8i through PEAR db class, I think 
it is the connection argument, any suggestion could help me, thanks in advanced, here 
you are the code:

htmlheadtitleTest DB Class - PEAR/title/head
body
table border=1
trthId/ththName/th/tr
?php
  //connect
  require_once('DB.php');
  $db =DB::connect(oci8://system:[EMAIL PROTECTED]/orcl);
  if (DB::iserror($db)) {
die($db-getMessage());
  }
  //issue the query
  $sql =SELECT *
 FROM test ORDER BY id ASC;
  $q =$db-query($sql);
  if (DB::iserror($q)) {
die($q-getMessage());
  }
  //generate table
  while ($q-fetchInto($row)) {
?
trtd?= $row[0] ?/td
td?= $row[1] ?/td
/tr
?php
  }
?
/table
/body/html


Re: [PHP] exec command

2003-10-01 Thread Nabil
so when i use php exec to do it , am i using apache user (nobody) or am i
using php user , is there a php  user ?
so what can i do ?
i want to execute
#useradd -d /home/all -g wahtever -s /bin/false newuser
as i want to create only pop user on the system when my user make
regestration.. to give him an email account

any comment ?



Ray Hunter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  I want to execute
  #useradd -d /home/all -g wahtever -s /bin/bash newuser

 You have to be root to add a user to the system...and just a heads
 up...you might want to rethink doing this from apache or php.  The
 security implications alone make me cringe.

 --
 Ray

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



[PHP] exec shell command from php

2003-10-01 Thread Nabil
hi all;

- When i run php.. what user am i using ? is it apache user (nobody) ??
- How can i execute useradd command from php ? should i write it in
pearl/cgi ??
- I want to grant my user on my web a free pop account (or webmail) so i
need to create an user with bin/false so he has no shell login but pop login
... how can i do this by php.. as exec('useradd ...
couldn't be done only by root . what user should i do ? what solution ..
i googled for virtual popuser .. and i didn't manage .. so i decided to do
it this way
any comment ?

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



[PHP] Can't find oci.h

2003-10-01 Thread Donahue, Peter
I'm building Php (4.3.3) on Solaris and am including oci8 support.
Configure works fine. When I try to build, I get an error on the compilation
of ext/oci8/oci8.c - it can't find oci.h, and then I get tons of errors,
I suppose all stemming from this.

I don't think this is supposed to be in the Oracle home directory, since
there is no -I swithes on the compile line that reference Oracle home,
except for -I/path/OraHome1/rdbms/demo

Does anyone know what I'm missing?
Below is the 1st make command:

/bin/sh /export/home/emsuser/ped/php-4.3.3/libtool --silent --preserve-dup-deps 
--mode=compile gcc
  -Iext/oci8/ -I/export/home/emsuser/ped/php-4.3.3/ext/oci8/ -DPHP_ATOM_INC
   -I/export/home/emsuser/ped/php-4.3.3/include 
-I/export/home/emsuser/ped/php-4.3.3/main
-I/export/home/emsuser/ped/php-4.3.3 -I/export/home/emsuser/ped/php-4.3.3/Zend
 -I/export/home/oracle/OraHome1/rdbms/demo 
-I/export/home/emsuser/ped/php-4.3.3/ext/xml/expat
  -D_POSIX_PTHREAD_SEMANTICS -I/export/home/emsuser/ped/php-4.3.3/TSRM  -g -O2  
-prefer-pic
   -c /export/home/emsuser/ped/php-4.3.3/ext/oci8/oci8.c -o ext/oci8/oci8.lo

---
Peter Donahue
Ciena Corp
[EMAIL PROTECTED]
978-489-2116

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



[PHP] Re: exec shell command from php

2003-10-01 Thread Gal
You are the apache user.
you can run this to find which user are you.
?php
passthru('whoami');
?


Nabil wrote:
hi all;

- When i run php.. what user am i using ? is it apache user (nobody) ??
- How can i execute useradd command from php ? should i write it in
pearl/cgi ??
- I want to grant my user on my web a free pop account (or webmail) so i
need to create an user with bin/false so he has no shell login but pop login
... how can i do this by php.. as exec('useradd ...
couldn't be done only by root . what user should i do ? what solution ..
i googled for virtual popuser .. and i didn't manage .. so i decided to do
it this way
any comment ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] storing japanese in mysql (or pgsql)

2003-10-01 Thread Chris W. Parker
- Edwin - mailto:[EMAIL PROTECTED]
on Tuesday, September 30, 2003 7:00 PM said:

 What exactly do you mean by extended characters? And, do you mean
 all *other* characters are inserted properly? Anyway,... 

I just mean the characters that you can't type unless you do something
like alt-250, alt-145, etc.

 If they're not ujis (for euc-jp), add this to your my.cnf file:
 (Under [mysqld] and [client]) 
 
   default-character-set = ujis

I added that line to the [mysqld] section but there was no [client]
section so i added the following.

[client]
default-character-set = ujis

 Btw, check your php.ini as well and make sure that your settings
 under [mbstring] are correct. 

Each line in the [mbstring] section was commented out. So I uncommented
them. I also uncommented the mbstring extension.


I'm just about to restart both servers, so we'll see what happens.



Thanks,
Chris.

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



Re: [PHP] (another) regex difficulty

2003-10-01 Thread Curt Zirzow
* Thus wrote jonas_weber @ gmx. ch ([EMAIL PROTECTED]):
 regular expressions
 the example below should turn any character exept \* (*= any char)
 into an x:

 $term = preg_replace('/[^(\\\)+(.){1}]/', 'x', $term);

preg_replace('/(?!\\).{1}/', 'x', $term);

this is untested but using the assertion (?!\\), meaning that the
string '\' doesn't appear before the character, should be the
direction to go.

see:
http://php.net/manual/en/pcre.pattern.syntax.php


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] exec shell command from php

2003-10-01 Thread Ray Hunter
If you are using apache and php then when php runs the exec function
then it is running the the user/group of the apache process. 

Here is what I might suggest doing. Have a registration form that
submits the user's information to another process that logs the
information (make sure to validate all information that is recieved).
Then have a cron job or something that runs as root process the valid
user requests and creates the accounts for you outside of apache and
then sends and email notification to the user stating that the account
has been set up. Then provide a link to activate that account. If the
account is not activated within a desired account then that account
needs to be deleted immediately.

These is just something off the top of my head. There needs to be tons
of time put into this and planned out or your box will become a hackers
haven.

--
Ray


On Wed, 2003-10-01 at 09:54, Nabil wrote:
 hi all;
 
 - When i run php.. what user am i using ? is it apache user (nobody) ??
 - How can i execute useradd command from php ? should i write it in
 pearl/cgi ??
 - I want to grant my user on my web a free pop account (or webmail) so i
 need to create an user with bin/false so he has no shell login but pop login
 ... how can i do this by php.. as exec('useradd ...
 couldn't be done only by root . what user should i do ? what solution ..
 i googled for virtual popuser .. and i didn't manage .. so i decided to do
 it this way
 any comment ?

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



Re: [PHP] exec shell command from php

2003-10-01 Thread Marek Kilimajer
Did you read my message on sudo?
This is how it gets done, so RTFM - 
http://www.courtesan.com/sudo/man/sudo.html

Nabil wrote:

hi all;

- When i run php.. what user am i using ? is it apache user (nobody) ??
- How can i execute useradd command from php ? should i write it in
pearl/cgi ??
- I want to grant my user on my web a free pop account (or webmail) so i
need to create an user with bin/false so he has no shell login but pop login
... how can i do this by php.. as exec('useradd ...
couldn't be done only by root . what user should i do ? what solution ..
i googled for virtual popuser .. and i didn't manage .. so i decided to do
it this way
any comment ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] (another) regex difficulty

2003-10-01 Thread CPT John W. Holmes
From: [EMAIL PROTECTED]

 regular expressions
 the example below should turn any character exept \* (*= any char)
 into an x:

 $term = preg_replace('/[^(\\\)+(.){1}]/', 'x', $term);

 but i guess because of the [brackets] the . (period) is treated as
 character . instead as metacharacter (that matches any char).

 anyone knows how to work around this?

Maybe...

$term = preg_replace('/[^\\]./','x',$term);

which would replace any character that's NOT a \ followed by any other
character with an x...

Not tested, of course. :)

---John Holmes...

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



[PHP] Variables not passed on localhost setup

2003-10-01 Thread Greg Watson
Hi Guys,

I've Googled and RTFM'd, but I can't seem to figure this out - it may
not even be a php problem but I'm not sure.
I've set up Apache, PHP and MySQL on my laptop running XP Home. Although
I've coded php for a while now, I had never set these up on my own
computer before. The php seems to be parsed ok, but it doesn't look as
though variables are being passed from page to page.
I used this as a VERY simple test:
-
p
  a href=index.php?TestVar=1Variable Test/a
  ?
if (!$TestVar) print font color='red'- Not Set/font;
if ($TestVar == 1) print font color='green'- Set and 
Displayed/font;
  ?
/p

-
When I use this code on my ISP webserver (which I think is running
RedHat Linux, and I know it obviously has php andMySQL), I get the 'Set
and Displayed' message after clicking on the link.
When I use it locally, although the url displays:
http://localhost/index.php?TestVar=1
I still get the 'Not Set' message.
I'm assuming I've not configured something correctly, but I don't know
where else to look! If anyone could help I'd be very grateful. At least 
if I know it's not the php and to look more at Apache or something!

Thank you,

Greg Watson

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


Re: [PHP] Variables not passed on localhost setup

2003-10-01 Thread CPT John W. Holmes
From: Greg Watson [EMAIL PROTECTED]
 doesn't look as
 though variables are being passed from page to page.

Register_globals is OFF in your php.ini file, so you need to use
$_GET['testvar'] instead of $testvar.

---John Holmes...

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



[PHP] Re: Variables not passed on localhost setup

2003-10-01 Thread Gal
The problem is that your php.ini has register_globals = Off
change it to On.
You can also do the following at the top of your script - (this is the 
correct way):
?php
$TestVar = (!empty($_GET['TestVar'])) ? true : false;
?

Greg Watson wrote:
Hi Guys,

I've Googled and RTFM'd, but I can't seem to figure this out - it may
not even be a php problem but I'm not sure.
I've set up Apache, PHP and MySQL on my laptop running XP Home. Although
I've coded php for a while now, I had never set these up on my own
computer before. The php seems to be parsed ok, but it doesn't look as
though variables are being passed from page to page.
I used this as a VERY simple test:
-
p
  a href=index.php?TestVar=1Variable Test/a
  ?
if (!$TestVar) print font color='red'- Not Set/font;
if ($TestVar == 1) print font color='green'- Set and 
Displayed/font;
  ?
/p

-
When I use this code on my ISP webserver (which I think is running
RedHat Linux, and I know it obviously has php andMySQL), I get the 'Set
and Displayed' message after clicking on the link.
When I use it locally, although the url displays:
http://localhost/index.php?TestVar=1
I still get the 'Not Set' message.
I'm assuming I've not configured something correctly, but I don't know
where else to look! If anyone could help I'd be very grateful. At least 
if I know it's not the php and to look more at Apache or something!

Thank you,

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


Re: [PHP] exec command

2003-10-01 Thread Dennis Sterzenbach
Nabil [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 so when i use php exec to do it , am i using apache user (nobody) or
am i
 using php user , is there a php  user ?
 so what can i do ?
 i want to execute
 #useradd -d /home/all -g wahtever -s /bin/false newuser
 as i want to create only pop user on the system when my user make
 regestration.. to give him an email account

 any comment ?

Question to your answer has already been given.
Review the thread and you will see it.

But to answer your question (again):
You are running as the user the Apache daemon got started.
Apache handles the request and recognizes that it has to
hand the request to PHP.

Still you will have to check the stuff entered before
executing!!!
See the posts by Javier Tacon!!

And to get it work, you must get the command executed as
root. This may be achieved by using sudo (please lookup
the man pages or internet for help on that!).

Just one comment at last:
Don't let Apache run as root! That would make it all worse
than using sudo for your script, because Apache could
execute critical code killing your system when running
as root. One who is in practice could hack your system
within seconds.
Apache always MUST run as a non-privileged user!


HTH.

--
 Dennis Sterzenbach
 www.darknoise.de

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



Re: [PHP] Variables not passed on localhost setup

2003-10-01 Thread Greg Watson
Thank you for that answer! That worked perfectly!

That leads me to another query, again, which I have searched for...

I'd like to be able to switch Register_Globals ON, but I can't find my 
php.ini file.

Running phpinfo(); tells me that my 'php.ini' file is stored in 
C:\WINDOWS, but it's not there. I've ran a file search and still can't 
find it.
The only ones that appear are 'php.ini-dist' and 'php.ini-recommended' 
which live in the installation directory. I followed a tutorial to 
install PHP, which didn't say anything about specifying whether you have 
a php.ini file or not.

Any clue as to why I don't have one, and how I should get one? I 
installed PHP v4.3.3 on Apache 1.3.

Thank you again for your time, I appreciate it.

Greg Watson

CPT John W. Holmes wrote:

From: Greg Watson [EMAIL PROTECTED]
 

doesn't look as
though variables are being passed from page to page.
   

Register_globals is OFF in your php.ini file, so you need to use
$_GET['testvar'] instead of $testvar.
---John Holmes...

 



Re: [PHP] Variables not passed on localhost setup

2003-10-01 Thread Gal
Reply - this means your php is running on php defaults configuration.
you need to copy the 'php.ini-dist' file as 'php.ini' to c:\windows.
edit the the file 'C:\windows\php.ini'
and change register_globals = Off to register_globals = On
Greg Watson wrote:
Thank you for that answer! That worked perfectly!

That leads me to another query, again, which I have searched for...

I'd like to be able to switch Register_Globals ON, but I can't find my 
php.ini file.

Running phpinfo(); tells me that my 'php.ini' file is stored in 
C:\WINDOWS, but it's not there. I've ran a file search and still can't 
find it.
The only ones that appear are 'php.ini-dist' and 'php.ini-recommended' 
which live in the installation directory. I followed a tutorial to 
install PHP, which didn't say anything about specifying whether you have 
a php.ini file or not.

Any clue as to why I don't have one, and how I should get one? I 
installed PHP v4.3.3 on Apache 1.3.

Thank you again for your time, I appreciate it.

Greg Watson

CPT John W. Holmes wrote:

From: Greg Watson [EMAIL PROTECTED]
 

doesn't look as
though variables are being passed from page to page.
  


Register_globals is OFF in your php.ini file, so you need to use
$_GET['testvar'] instead of $testvar.
---John Holmes...

 


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


Re: [PHP] Mail.php help

2003-10-01 Thread Jason Wong
On Wednesday 01 October 2003 23:18, Eric Rounds wrote:

 A quick way to check whether mail is configured correctly is to use the
  mail option of error_log().

 How do I do this? Set up an echo on my form page?

 ?
 echo mail error_log();
 ?

 ???

???

Look up the manual entry for error_log() to see how it works.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Even if you're on the right track, you'll get run over if you just sit there.
-- Will Rogers
*/

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



Re: [PHP] Variables not passed on localhost setup

2003-10-01 Thread Ray Hunter
rename php.ini-recommended to php.ini and put it in C:\windows and you
can now use that file.

--
Ray

On Wed, 2003-10-01 at 10:52, Greg Watson wrote:
 Thank you for that answer! That worked perfectly!
 
 That leads me to another query, again, which I have searched for...
 
 I'd like to be able to switch Register_Globals ON, but I can't find my 
 php.ini file.
 
 Running phpinfo(); tells me that my 'php.ini' file is stored in 
 C:\WINDOWS, but it's not there. I've ran a file search and still can't 
 find it.
 The only ones that appear are 'php.ini-dist' and 'php.ini-recommended' 
 which live in the installation directory. I followed a tutorial to 
 install PHP, which didn't say anything about specifying whether you have 
 a php.ini file or not.
 
 Any clue as to why I don't have one, and how I should get one? I 
 installed PHP v4.3.3 on Apache 1.3.
 
 Thank you again for your time, I appreciate it.
 
 Greg Watson
 
 CPT John W. Holmes wrote:
 
 From: Greg Watson [EMAIL PROTECTED]
   
 
 doesn't look as
 though variables are being passed from page to page.
 
 
 
 Register_globals is OFF in your php.ini file, so you need to use
 $_GET['testvar'] instead of $testvar.
 
 ---John Holmes...
 
   
 

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



Re: [PHP] Variables not passed on localhost setup

2003-10-01 Thread Brad Pauly
Greg Watson wrote:
I'd like to be able to switch Register_Globals ON, but I can't find my 
php.ini file.

Running phpinfo(); tells me that my 'php.ini' file is stored in 
C:\WINDOWS, but it's not there. I've ran a file search and still can't 
find it.
The only ones that appear are 'php.ini-dist' and 'php.ini-recommended' 
which live in the installation directory. I followed a tutorial to 
install PHP, which didn't say anything about specifying whether you have 
a php.ini file or not.

Any clue as to why I don't have one, and how I should get one? I 
installed PHP v4.3.3 on Apache 1.3.
Check out the Windows installation section of the manual.

http://www.php.net/manual/en/install.windows.php

Basically, you need to copy one of the ones that comes with php into 
your windows directory.

- Brad

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


Re: [PHP] Variables not passed on localhost setup

2003-10-01 Thread CPT John W. Holmes
From: Gal [EMAIL PROTECTED]


 Reply - this means your php is running on php defaults configuration.
 you need to copy the 'php.ini-dist' file as 'php.ini' to c:\windows.
 edit the the file 'C:\windows\php.ini'
 and change register_globals = Off to register_globals = On

(and restart your web server)

(and make sure you understand the security implications that may arise from
having globals on and poorly written code)

(and brush your teeth)

---John Holmes...

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



[PHP] documentation on

2003-10-01 Thread Rich Fox
Can someone point me to documentation on the  operator? I am wondering if
there are some quirks I don't know about. Yet I can't find it documented on
the php website.

THanks,

Rich

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



  1   2   3   >