[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] 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



[PHP] SELECT MULTIPLE form variable?

2003-06-14 Thread Noel Wade
Hi all,

So I was under the impression that an HTML form SELECT MULTIPLE item would
return an array with all of the selected items.  This array can then be used
with any of the standard PHP array functions, yes?

I have 1 HTML page that seems to work fine...  However, another page that is
nearly identical is failing - giving me the following error:  Wrong
datatype for second argument in call to in_array.  When I look at the
variable, it seems to ONLY contain a string - the first item the user
selected.

The only difference I can see is that the working SELECT MULTIPLE has
numerical values, and the dysfunctional one uses string values - but the
values ARE enclosed in quotation-marks... so I don't know why they're not
POSTing properly as an array.  Is this a known bug or issue?  Any thoughts
or solutions?

Thanks a bunch, take care,

--Noel



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



Re: [PHP] SELECT MULTIPLE form variable?

2003-06-14 Thread Leif K-Brooks
You need to name it formfield[], not formfield.

Noel Wade wrote:

Hi all,

So I was under the impression that an HTML form SELECT MULTIPLE item would
return an array with all of the selected items.  This array can then be used
with any of the standard PHP array functions, yes?
I have 1 HTML page that seems to work fine...  However, another page that is
nearly identical is failing - giving me the following error:  Wrong
datatype for second argument in call to in_array.  When I look at the
variable, it seems to ONLY contain a string - the first item the user
selected.
The only difference I can see is that the working SELECT MULTIPLE has
numerical values, and the dysfunctional one uses string values - but the
values ARE enclosed in quotation-marks... so I don't know why they're not
POSTing properly as an array.  Is this a known bug or issue?  Any thoughts
or solutions?
Thanks a bunch, take care,

--Noel



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


Re: [PHP] SELECT MULTIPLE form variable?

2003-06-14 Thread Noel Wade
Its the littlest things that kill ya  Thanks a ton!

As a side note, I definitely do NOT have the brackets on the working page -
so its an undefined feature (or bug) that numerical-value SELECT MULTIPLE
variables post as an array to PHP.

Take care, and thanks again!

--Noel

- Original Message -
From: Leif K-Brooks [EMAIL PROTECTED]
To: Noel Wade [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, June 14, 2003 1:26 PM
Subject: Re: [PHP] SELECT MULTIPLE form variable?


 You need to name it formfield[], not formfield.

 Noel Wade wrote:

 Hi all,
 
 So I was under the impression that an HTML form SELECT MULTIPLE item
would
 return an array with all of the selected items.  This array can then be
used
 with any of the standard PHP array functions, yes?
 
 I have 1 HTML page that seems to work fine...  However, another page that
is
 nearly identical is failing - giving me the following error:  Wrong
 datatype for second argument in call to in_array.  When I look at the
 variable, it seems to ONLY contain a string - the first item the user
 selected.
 
 The only difference I can see is that the working SELECT MULTIPLE has
 numerical values, and the dysfunctional one uses string values - but the
 values ARE enclosed in quotation-marks... so I don't know why they're not
 POSTing properly as an array.  Is this a known bug or issue?  Any
thoughts
 or solutions?
 
 Thanks a bunch, take care,
 
 --Noel
 
 
 
 
 

 --
 The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.





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



Re: [PHP] Select multiple boxes

2003-01-21 Thread Chris Hewitt
John W. Holmes wrote:



How does php know what suitable form data is?

I guess it could look for multiple names in the GET or POST data. But
then that would mean for every variable it goes to create, it would have
to go and look if it's already created one by that name. If it did,
erase the old one and make these two an array now. 

I guess this is what Oracle 8i must do since if there is more than one 
element of the same name then an array is automatically made. Seems fine 
except that the special case of when you are expecting more than one but 
only one exists. It is no longer an array. Either extra code to handle 
it, or what I often do is add a hidden dummy element of the same name to 
force an array.

Rather than doing that, it can just look for [] in the name and it knows
to make that an array.


All in all, I think the [] syntax ends up with less work for me to do. 
So IMHO I feel PHP has it right.

Regards

Chris



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



RE: [PHP] Select multiple boxes

2003-01-20 Thread Ford, Mike [LSS]
 -Original Message-
 From: Cal Evans [mailto:[EMAIL PROTECTED]]
 Sent: 18 January 2003 14:41
 
 use [] in your select box name. When it comes back in the 
 $_POST array you
 will have an array of options.  It breaks HTML standard 

No, it does not break HTML standards -- that is a PHP urban myth (which, to
my chagrin, I helped to propagate before a wiser head sent me to read said
standards in minute detail).  It does not even break XHTML standards.

Believe me -- I've interrogated the damn standards to within an inch of
their lives, and they nonetheless insist that [] are legal characters in
form element name= attributes, and form element name= attributes are *not*
deprecated.

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] Select multiple boxes

2003-01-20 Thread Sean Burlington
Ford, Mike [LSS] wrote:

-Original Message-
From: Cal Evans [mailto:[EMAIL PROTECTED]]
Sent: 18 January 2003 14:41

use [] in your select box name. When it comes back in the 
$_POST array you
will have an array of options.  It breaks HTML standard 


No, it does not break HTML standards -- that is a PHP urban myth (which, to
my chagrin, I helped to propagate before a wiser head sent me to read said
standards in minute detail).  It does not even break XHTML standards.

Believe me -- I've interrogated the damn standards to within an inch of
their lives, and they nonetheless insist that [] are legal characters in
form element name= attributes, and form element name= attributes are *not*
deprecated.



while I agree that it doesn't break standards - I do find it odd.

and annoying in that it limits the ability of php to  process certain 
forms ...

I don't see any benefit of this system - it would be better if php just 
created an array for suitable form data - without requiring that the 
element name changes.

still - I guess it works :)

--

Sean



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



RE: [PHP] Select multiple boxes

2003-01-20 Thread John W. Holmes
 use [] in your select box name. When it comes back in the
 $_POST array you
 will have an array of options.  It breaks HTML standard
 
 
  No, it does not break HTML standards -- that is a PHP urban myth
(which,
 to
  my chagrin, I helped to propagate before a wiser head sent me to
read
 said
  standards in minute detail).  It does not even break XHTML
standards.
 
  Believe me -- I've interrogated the damn standards to within an inch
of
  their lives, and they nonetheless insist that [] are legal
characters in
  form element name= attributes, and form element name= attributes are
 *not*
  deprecated.
 
 
 while I agree that it doesn't break standards - I do find it odd.
 
 and annoying in that it limits the ability of php to  process certain
 forms ...
 
 I don't see any benefit of this system - it would be better if php
just
 created an array for suitable form data - without requiring that the
 element name changes.

How does php know what suitable form data is?

I guess it could look for multiple names in the GET or POST data. But
then that would mean for every variable it goes to create, it would have
to go and look if it's already created one by that name. If it did,
erase the old one and make these two an array now. 

Rather than doing that, it can just look for [] in the name and it knows
to make that an array.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP] Select multiple boxes

2003-01-20 Thread Sean Burlington
John W. Holmes wrote:

use [] in your select box name. When it comes back in the
$_POST array you
will have an array of options.  It breaks HTML standard



No, it does not break HTML standards -- that is a PHP urban myth


(which,


to


my chagrin, I helped to propagate before a wiser head sent me to


read


said


standards in minute detail).  It does not even break XHTML


standards.


Believe me -- I've interrogated the damn standards to within an inch


of


their lives, and they nonetheless insist that [] are legal


characters in


form element name= attributes, and form element name= attributes are


*not*


deprecated.



while I agree that it doesn't break standards - I do find it odd.

and annoying in that it limits the ability of php to  process certain
forms ...

I don't see any benefit of this system - it would be better if php


just


created an array for suitable form data - without requiring that the
element name changes.



How does php know what suitable form data is?

I guess it could look for multiple names in the GET or POST data. But
then that would mean for every variable it goes to create, it would have
to go and look if it's already created one by that name. If it did,
erase the old one and make these two an array now. 

Rather than doing that, it can just look for [] in the name and it knows
to make that an array.


well I think you answered your own query - it could look for multiple 
names ...

this seems to work well in other systems - eg Perl:CGI and Java Servlets 
 - though as these have seperate types for an array - so it works quite 
naturally there.

in fact I have only seen this construct in php - it seems odd to me.

I have worked on several projects where forms have been used to 
communicate between systems under the control of different development 
teams - in this case the requirement to rename the form element for it 
to work as a select multiple has been a pain.

--

Sean




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



RE: [PHP] Select multiple boxes

2003-01-18 Thread Cal Evans
use [] in your select box name. When it comes back in the $_POST array you
will have an array of options.  It breaks HTML standard therefore it is a
Bad Thing (tm) but it does work.

SELECT name=mySelect[] multi 
option name='1'Don't pick me/option
option name='2'Pick me/option
/select

Selecting both results in:

$_POST['mySelect'][1] == Don't pick me
$_POST['mySelect'][2] == Pick me

HTH,
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Gregory Chagnon [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 11:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Select multiple boxes


Hi-
Is there any way to get all of the elements in a SELECT MULTIPLE box, not
just the ones that are selected?  Thanks!
-Greg



--
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] Select multiple boxes

2003-01-18 Thread John W. Holmes
 Is there any way to get all of the elements in a SELECT MULTIPLE box,
not
 just the ones that are selected?  Thanks!

No. You create the box, so you should know all of the possible values. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP] Select multiple boxes

2003-01-18 Thread Cal Evans
whoops. Sorry, didn't read the question. Wrong answer. John gave the correct
answer.

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Cal Evans [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 18, 2003 8:41 AM
To: Gregory Chagnon; [EMAIL PROTECTED]
Subject: RE: [PHP] Select multiple boxes


use [] in your select box name. When it comes back in the $_POST array you
will have an array of options.  It breaks HTML standard therefore it is a
Bad Thing (tm) but it does work.

SELECT name=mySelect[] multi 
option name='1'Don't pick me/option
option name='2'Pick me/option
/select

Selecting both results in:

$_POST['mySelect'][1] == Don't pick me
$_POST['mySelect'][2] == Pick me

HTH,
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Gregory Chagnon [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 11:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Select multiple boxes


Hi-
Is there any way to get all of the elements in a SELECT MULTIPLE box, not
just the ones that are selected?  Thanks!
-Greg



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



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



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




Re: [PHP] Select multiple boxes

2003-01-18 Thread Gregory Chagnon
The problem is I have 2 seelect boxes...it's for creating a user and adding
them to a list of available groups...so I have one select box that is
initially empty called memberOf and another box that has all of the
available groups listed in it called availableGroups.  I have a script that
can move items back and forth and when the form is submitted I want to be
able to get all the items that are in the memberOf box..anyh ideas on how to
to this?  THanks.
-Greg


John W. Holmes [EMAIL PROTECTED] wrote in message
000501c2bf01$46464cc0$7c02a8c0@coconut">news:000501c2bf01$46464cc0$7c02a8c0@coconut...
  Is there any way to get all of the elements in a SELECT MULTIPLE box,
 not
  just the ones that are selected?  Thanks!

 No. You create the box, so you should know all of the possible values.

 ---John W. Holmes...

 PHP Architect - A monthly magazine for PHP Professionals. Get your copy
 today. http://www.phparch.com/





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




RE: [PHP] Select multiple boxes

2003-01-18 Thread John W. Holmes
 The problem is I have 2 seelect boxes...it's for creating a user and
 adding
 them to a list of available groups...so I have one select box that is
 initially empty called memberOf and another box that has all of the
 available groups listed in it called availableGroups.  I have a script
 that
 can move items back and forth and when the form is submitted I want to
be
 able to get all the items that are in the memberOf box..anyh ideas on
how
 to
 to this?  THanks.

Well, you create the memberOf box, right? How do you do that? At the
same time, create a javascript or hidden variable that has its contents
to be passed along with the form. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP] Select multiple boxes

2003-01-18 Thread Cal Evans
What you are describing is a 2 List Mover. PHP is a server-side language
and as such knows nothing about what is going on on the client. Therefore
you have limited options. My favorite is :

In your form's onSubmit() put code to load all the values into a hidden
field. (Assuming you have defined the hidden field)

hidden name=StoreStuffhere

in your JavaScript put things like

document.mainForm.storeStuffHere.value += storeStuffHere[1]='Value1';
document.mainForm.storeStuffHere.value += storeStuffHere[2]='Value2';
document.mainForm.storeStuffHere.value += storeStuffHere[3]='Value3';

Then, when the form is submitted use:

parse_str($_POST['storeStuffHere']);

This will create the array storeStuffHere with the 3 values.

HTH,
=C=
*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Gregory Chagnon [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 18, 2003 9:31 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Select multiple boxes


The problem is I have 2 seelect boxes...it's for creating a user and adding
them to a list of available groups...so I have one select box that is
initially empty called memberOf and another box that has all of the
available groups listed in it called availableGroups.  I have a script that
can move items back and forth and when the form is submitted I want to be
able to get all the items that are in the memberOf box..anyh ideas on how to
to this?  THanks.
-Greg


John W. Holmes [EMAIL PROTECTED] wrote in message
000501c2bf01$46464cc0$7c02a8c0@coconut">news:000501c2bf01$46464cc0$7c02a8c0@coconut...
  Is there any way to get all of the elements in a SELECT MULTIPLE box,
 not
  just the ones that are selected?  Thanks!

 No. You create the box, so you should know all of the possible values.

 ---John W. Holmes...

 PHP Architect - A monthly magazine for PHP Professionals. Get your copy
 today. http://www.phparch.com/





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



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




[PHP] Select multiple boxes

2003-01-17 Thread Gregory Chagnon
Hi-
Is there any way to get all of the elements in a SELECT MULTIPLE box, not
just the ones that are selected?  Thanks!
-Greg



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




[PHP] SELECT MULTIPLE...

2002-11-11 Thread Bsantos PHP
Hello:

I'm building an internal messaging system for small biz companies and I
can't really go longer

Problem is, I use some fields to make the message form and one of them must
be a select multiple form element wich refers to messaging persons. This is
my form:

table
tr
 td height=15 valign=topP class=P1Para:/P/td
 td
  SELECT NAME=receptor[] size=6 multiple
  ?
  //Legenda: eu - significa eusers || pu - significa preparar lista de
utilizadores
  $eu_pu_result = mysql_query(SELECT u.name, u.email FROM users u);
  while ($eu_pu = mysql_fetch_row($eu_pu_result)) {
   for ($i=0;$i1;$i++) {
echooption$eu_pu[0];
   }
  }
  ?
  /select
 /td
/tr
tr
 td height=15 valign=topP class=P1Prioridade:/P/td
 td
  select name=priority
   option value=MínimaMínima/option
   option SELECTED value=NormalNormal/option
   option value=PrioritáriaPrioritária/option
   option value=UrgenteUrgente/option
  /select
 /td
/tr
tr
 td height=15 valign=topP class=P1Assunto:/P/td
 tdinput type=text name=title size=66 value=? pv($frm[title])
?/td
/tr
tr
 td height=15 valign=topP class=P1Descrição:/P/td
 tdtextarea name=description cols=50 rows=8?
pv($frm[description]) ?/textarea/td
/tr
tr
 tdnbsp;!--EmptyCellContent--/td
 tdinput type=submit value=?=$frm[submit_caption] ?/td
/tr
   /table

After this, the page should reload on submit, but I keep getting the
warning:

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
on line 110

Warning: Undefined index: categories in
c:/apache/htdocs/sites/mail/admin/eusers.php on line 120

All but the last, I think they appear because then page reloaded can't see
any more the array of people (select form).

But... How can I solve the problem?

This is the file that is the page itself, as above in the warnings, called
by:eusers.php:

?
/***
***
 * FUNCTIONS


*/

function print_add_product_form($category_id = 0) {
/* print a blank product form so we can add a new product */

 global $mfi, $ME;

 /* set default values for the reset of the fields */
 $frm[categories] = array($category_id);
 $frm[newmode] = insert;
 $frm[receptor] = ;
 $frm[recipient] = ;
 $frm[priority] = ;
 $frm[title] = ;
 $frm[description] = ;
 $frm[on_special] = ;
 $frm[submit_caption] = Enviar;

 /* build the categories listbox options, preselect the top item */
 build_category_tree($category_options, $frm[categories]);

 include(templates/eusers_form.php);
}

function print_edit_product_form($id) {
/* print a product form so we can edit the selected product */

 global $mfi, $ME;

 /* load up the information for the product */
 $qid = db_query(
 SELECT receptor, recipient, priority, title, description, stage, on_special
 FROM products
 WHERE id = $id
 );
 $frm = db_fetch_array($qid);

 /* load up the categories for the product */
 $qid = db_query(
 SELECT category_id
 FROM products_categories
 WHERE product_id = $id
 );

 $frm[categories] = array();
 while ($cat = db_fetch_object($qid)) {
  $frm[categories][] = $cat-category_id;
 }

 /* set values for the form */
 $frm[newmode] = update;
 $frm[submit_caption] = Enviar;

 /* build the categories listbox options, preselect the selected item */
 build_category_tree($category_options, $frm[categories]);

 include(templates/eusers_edit_form.php);
}

function delete_product($id) {
/* delete the product specified by $id, we have to delete the product and
then
 * the appropriate entries from the products_categories table.  this should
be
 * wrapped inside a transaction, unfortunately MySQL currently does not
support
 * transactions. */

 global $mfi, $ME;

 /* load up the information for the product */
 $qid = db_query(
 SELECT title
 FROM products
 WHERE id = $id
 );
 $prod = db_fetch_object($qid);

 /* delete this product */
 $qid = db_query(
 DELETE FROM products
 WHERE id = $id
 );

 /* delete this product from the products_categories table */
 $qid = db_query(
 DELETE FROM products_categories
 WHERE product_id = $id
 );

 include(templates/eusers_deleted.php);
}

function insert_product($id, $frm) {
/* add a new subproduct under the parent $id.  all the fields that we want
are
 * going to in the variable $frm */

 global $mfi, $ME;

 $on_special = checked($frm[on_special]);

 /* add the product into the products 

Re: [PHP] SELECT MULTIPLE...

2002-11-11 Thread Jason Wong
On Monday 11 November 2002 17:51, Bsantos PHP wrote:
 Hello:

 I'm building an internal messaging system for small biz companies and I
 can't really go longer

 Problem is, I use some fields to make the message form and one of them must
 be a select multiple form element wich refers to messaging persons. This
 is my form:


[snip]

 After this, the page should reload on submit, but I keep getting the
 warning:

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: 1 in c:/apache/htdocs/sites/mail/admin/eusers.php
 on line 110

 Warning: Undefined index: categories in
 c:/apache/htdocs/sites/mail/admin/eusers.php on line 120

Which is line 110 and line 120? 

I'm certainly not going to count the lines in your code to see which lines 
they refer to. 

If you want people to help you, you should make it easier for them to do so by 
indicating which lines are being referred to as 110  120.

 All but the last, I think they appear because then page reloaded can't see
 any more the array of people (select form).

Well, try using print_r() on all your important variables at strategic places 
in your code to see that they contain what you expect them to contain.

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

/*
Utility is when you have one telephone, luxury is when you have two,
opulence is when you have three -- and paradise is when you have none.
-- Doug Larson
*/


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




Re: [PHP] SELECT MULTIPLE...

2002-11-11 Thread Bsantos PHP
Sorry People:

I really forget that:

Line 110:

VALUES ('$receptor[1]', '$mfi-email', '$frm[priority]', '$frm[title]',
'$frm[description]', now(), '$on_special')

which makes part of:

if (!isset ($receptor[])) {
  $receptor[] = {0,0,0,0,0,0};
 } else {
 }
 for ($i=0;$i6;$i++) {
   $qid = db_query(
INSERT INTO products (receptor, recipient, priority, title, description,
date_added, on_special)
VALUES ('$receptor[1]', '$mfi-email', '$frm[priority]', '$frm[title]',
'$frm[description]', now(), '$on_special')
   );
 }

Line 120:

for ($i = 0; $i  count($frm[categories]); $i++) {

which makes part of:

$product_id = db_insert_id();

 /* add this product under the specified categories */
 for ($i = 0; $i  count($frm[categories]); $i++) {
  $qid = db_query(
  INSERT INTO products_categories (category_id, product_id)
  VALUES ('{$frm[categories][$i]}', '$product_id')
  );
 }



An this two parts, build a function:

function insert_product($id, $frm) {
/* add a new subproduct under the parent $id.  all the fields that we want
are
 * going to in the variable $frm */

 global $mfi, $ME;

 $on_special = checked($frm[on_special]);

 /* add the product into the products table */
 if (!isset ($receptor[])) {
  $receptor[] = {0,0,0,0,0,0};
 } else {
 }
 for ($i=0;$i6;$i++) {
   $qid = db_query(
INSERT INTO products (receptor, recipient, priority, title, description,
date_added, on_special)
VALUES ('$receptor[1]', '$mfi-email', '$frm[priority]', '$frm[title]',
'$frm[description]', now(), '$on_special')
   );
 }


//mail('$frm[receptor]','$frm[title]','$frm[description]','$frm[recipient]')
;

 /* get the product id that was just created */
 $product_id = db_insert_id();

 /* add this product under the specified categories */
 for ($i = 0; $i  count($frm[categories]); $i++) {
  $qid = db_query(
  INSERT INTO products_categories (category_id, product_id)
  VALUES ('{$frm[categories][$i]}', '$product_id')
  );
 }
}

Really sorry... again



Jason Wong [EMAIL PROTECTED] wrote in message
news:20021802.38606.php-general;gremlins.com.hk...
 On Monday 11 November 2002 17:51, Bsantos PHP wrote:
  Hello:
 
  I'm building an internal messaging system for small biz companies and I
  can't really go longer
 
  Problem is, I use some fields to make the message form and one of them
must
  be a select multiple form element wich refers to messaging persons.
This
  is my form:


 [snip]

  After this, the page should reload on submit, but I keep getting the
  warning:
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: 1 in
c:/apache/htdocs/sites/mail/admin/eusers.php
  on line 110
 
  Warning: Undefined index: categories in
  c:/apache/htdocs/sites/mail/admin/eusers.php on line 120

 Which is line 110 and line 120?

 I'm certainly not going to count the lines in your code to see which lines
 they refer to.

 If you want people to help you, you should make it easier for them to do
so by
 indicating which lines are being referred to as 110  120.

  All but the last, I think they appear because then page reloaded can't
see
  any more the array of people (select form).

 Well, try using print_r() on all your important variables at strategic
places
 in your code to see that they contain what you expect them to contain.

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

 /*
 Utility is when you have one telephone, luxury is when you have two,
 opulence is when you have three -- and paradise is when you have none.
 -- Doug Larson
 */




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




RE: [PHP] SELECT MULTIPLE...

2002-11-11 Thread John W. Holmes
 Line 110:
 
 VALUES ('$receptor[1]', '$mfi-email', '$frm[priority]',
'$frm[title]',
 '$frm[description]', now(), '$on_special')

Those errors are just warnings. It's telling you that $receptor[1]
does not have a value when it reaches that statement. Does that matter
to you? You may want to throw in a check before this statement that
assigns a default value to $receptor[1]. Or, if it's not supposed to
ever be empty, then you've got some debugging to do. The problem is the
same for your other error, too.

---John Holmes... 



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




[PHP] select multiple

2002-07-31 Thread [EMAIL PROTECTED]

Hello,
i have done as told to select multiple value from a html
form, but i cannot insert all of them into  MySql
database.
it inserts Array into the field, instead of the list of
values.
What can i do?
Is there a special script to insert them?
i tried,
$str = ;
foreach ($tableau as $k=$v)
$str= $v .  ;
$sjt1=$_POST[sjt1]; and then the insert command
(among others )but it's always the same story. Please
help, thanks

---
L'e-mail gratuit pas comme les autres.
NOMADE.FR, pourquoi chercher ailleurs ?



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




Re: [PHP] select multiple

2002-07-31 Thread Martin Clifford

It depends on how you want them to be in the database.  If you want comma-delimited, 
then just use implode().

$array = array(Red, Blue, Green);
$comma_seperated = implode(, , $array);
$space_seperated = implode( , $array);

There really is no limit to how you want to do this.  Then just use explode() with the 
same arguments (although replace array with the comma_seperated string) to go back to 
an array.

HTH!

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


 [EMAIL PROTECTED] [EMAIL PROTECTED] 07/31/02 08:56AM 
Hello,
i have done as told to select multiple value from a html
form, but i cannot insert all of them into  MySql
database.
it inserts Array into the field, instead of the list of
values.
What can i do?
Is there a special script to insert them?
i tried,
$str = ;
foreach ($tableau as $k=$v)
$str= $v .  ;
$sjt1=$_POST[sjt1]; and then the insert command
(among others )but it's always the same story. Please
help, thanks

---
L'e-mail gratuit pas comme les autres.
NOMADE.FR, pourquoi chercher ailleurs ?



--
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] select multiple

2002-07-31 Thread 1LT John W. Holmes

Use implode to make the array into a string and insert that. Depends on your
database structure exactly how you'd do it...

www.php.net/implode

---John Holmes...

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 31, 2002 8:56 AM
Subject: [PHP] select multiple


Hello,
i have done as told to select multiple value from a html
form, but i cannot insert all of them into  MySql
database.
it inserts Array into the field, instead of the list of
values.
What can i do?
Is there a special script to insert them?
i tried,
$str = ;
foreach ($tableau as $k=$v)
$str= $v .  ;
$sjt1=$_POST[sjt1]; and then the insert command
(among others )but it's always the same story. Please
help, thanks

---
L'e-mail gratuit pas comme les autres.
NOMADE.FR, pourquoi chercher ailleurs ?



--
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] select multiple within for-each

2002-07-15 Thread William S.

This works OK with creating buttons but is not what I want.
POST/INPUT

xsl:for-each select=. . . 
xsl:sort/

form
xsl:attribute name=namemyform/xsl:attribute
xsl:attribute name=actionlist.php/xsl:attribute
xsl:attribute name=methodpost/xsl:attribute
input
xsl:attribute name=typesubmit/xsl:attribute
xsl:attribute name=nameinsert/xsl:attribute
xsl:attribute name=valuexsl:value-of 
select=.//xsl:attribute
/input
/form
/xsl:for-each

***This is what I would like to do but it does _not_ work and is wrong.***
POST/SELECT MULTIPLE

xsl:for-each select=. . . 
xsl:sort/

form
xsl:attribute name=namemyform/xsl:attribute
xsl:attribute name=actionlist.php/xsl:attribute
xsl:attribute name=methodpost/xsl:attribute
select
xsl:attribute name=multiple/xsl:attribute
xsl:attribute name=nameinsert/xsl:attribute
option
xsl:attribute name=valuexsl:value-of 
select=.//xsl:attribute
xsl:value-of select=./
/option
/select
/form
/xsl:for-each

So how do I get a select-multiple form to work this way?

-- 
Bill
Amsterdam, NL

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




Re: [PHP] select multiple within for-each (SOLVED)

2002-07-15 Thread William S.

Please disregard the previous posting I made. I figured it
out.

On Mon, Jul 15, 2002 at 10:52:23AM +0200, William S. wrote:
 This works OK with creating buttons but is not what I want.
 POST/INPUT
 
   xsl:for-each select=. . . 
   xsl:sort/
 
   form
   xsl:attribute name=namemyform/xsl:attribute
snip

-- 
Bill
Amsterdam, NL

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