Re: [suse-linux-uk-schools] Any PHP experts out there?
----- Original Message -----
From: "Matt Williams"
Hi Adrian
When using multiple select boxes you have to append the name of the select element with [] so PHP know to expect/convert it to an array.
so you example would need to be <select name="dcdrom[]" size="3" multiple id="dcdrom">
$_POST['dcdrom'] will now be an array
Thanks Matt :-) Having looked over some examples again, I see that now but missed it before! (But you'd be amazed how many typo's there are out there. I don't understand why people don't copy and paste). It now returns "array" :-) Many Many thanks :-)
Hi Adrian
When using multiple select boxes you have to append the name of the select element with [] so PHP know to expect/convert it to an array.
so you example would need to be <select name="dcdrom[]" size="3" multiple id="dcdrom">
$_POST['dcdrom'] will now be an array
Thanks Matt :-)
Having looked over some examples again, I see that now but missed it before! (But you'd be amazed how many typo's there are out there. I don't understand why people don't copy and paste).
It now returns "array" :-)
Many Many thanks :-)
As an aside, I was unable to edit the data via a subroutine, although I was able to show that the correct data was being passed/processed, it just trashed the data, wierd! but if I did the updates in-line no problem! Maybe it has something to do with threads within PHP Version 4.3.3 ? Anyway all fixed now and I'm grinning again :-) Three days messing about, all for a pair of square braces! Kind regards Adrian
I thought PHP was supposed to be thread-safe? The only circumstances under which there is believed to be issues is Apache2, but most people I've spoken to who use Apache 2 in their LAMP servers haven't reported any issues at all. On 26 Aug 2004 at 16:05, adrian.wells wrote:
Hi Adrian
When using multiple select boxes you have to append the name of the select element with [] so PHP know to expect/convert it to an array.
so you example would need to be <select name="dcdrom[]" size="3" multiple id="dcdrom">
$_POST['dcdrom'] will now be an array
Thanks Matt :-)
Having looked over some examples again, I see that now but missed it before! (But you'd be amazed how many typo's there are out there. I don't understand why people don't copy and paste).
It now returns "array" :-)
Many Many thanks :-)
As an aside, I was unable to edit the data via a subroutine, although I was able to show that the correct data was being passed/processed, it just trashed the data, wierd! but if I did the updates in-line no problem! Maybe it has something to do with threads within PHP Version 4.3.3 ? Anyway all fixed now and I'm grinning again :-) Three days messing about, all for a pair of square braces! Kind regards Adrian -- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com ----- Paul Graydon Network Technician Haywards Heath Sixth Form College http://www.hhc.ac.uk (01444) 456281 In the end, we will remember not the words of our enemies, but the silence of our friends. - Martin Luther King Jr. (1929 - 1968)
Hi Paul, Thanks for your note, purely for interest... I found that using a call to my function worked perfectly if I used it once. If I called it more than once (on the same page), with data for different tables, it would correctly delete all existing references as required (these are just linking tables) but added all subsequent data to the first table referenced even though I could print the correct table name for each call! Using any of the calls to my function singly (slashing out the others) worked fine. I'd wasted so much time with the square braces fiasco that I decided to do the updates in-line and they worked fine first time! Maybe it's a machine issue, although I've seen no other problems and it serves the pages plenty quick enough for our needs. Our LAMP is using everything as standard (may have on-line updates) from the SuSE 9.0 disks on a Dell P2 266 optiplex with 96MB (?) and a 2GB HDD Since PHP 5.0.1 has been released, I'll not bother to report it as a bug - but it did help loosen a little more hair :-) Kind regards Adrian
I thought PHP was supposed to be thread-safe? The only circumstances under which there is believed to be issues is Apache2, but most people I've spoken to who use Apache 2 in their LAMP servers haven't reported any issues at all.
On 26 Aug 2004 at 16:05, adrian.wells wrote:
Hi Adrian
When using multiple select boxes you have to append the name of the select element with [] so PHP know to expect/convert it to an array.
so you example would need to be <select name="dcdrom[]" size="3" multiple id="dcdrom">
$_POST['dcdrom'] will now be an array
Thanks Matt :-)
Having looked over some examples again, I see that now but missed it before! (But you'd be amazed how many typo's there are out there. I don't understand why people don't copy and paste).
It now returns "array" :-)
Many Many thanks :-)
As an aside, I was unable to edit the data via a subroutine, although I was able to show that the correct data was being passed/processed, it just trashed the data, wierd! but if I did the updates in-line no problem! Maybe it has something to do with threads within PHP Version 4.3.3 ? Anyway all fixed now and I'm grinning again :-)
Three days messing about, all for a pair of square braces!
Kind regards Adrian
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com
----- Paul Graydon Network Technician Haywards Heath Sixth Form College http://www.hhc.ac.uk (01444) 456281
In the end, we will remember not the words of our enemies, but the silence of our friends. - Martin Luther King Jr. (1929 - 1968)
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com
*sounds of strained braincells heard across campus* PHP isn't really my language (not yet at least.. just starting to learn it now I'm taking on the Intranet development here), but I seem to recall when I went through some on-line PHP tutorials the writer advising that you should open and close the database independantly inside a function.. I thought that was a bit OTT and timewasting amongst other things. Might have some value? I'm learning from the "PHP and MySQL Web Development" book at the moment (http://www.amazon.co.uk/exec/obidos/ASIN/067232525X/qid=109402 5644/ref=sr_8_xs_ap_i1_xgl/026-8725205-8171660), and that certainly doesn't seem to follow that advice. *shrug* On 31 Aug 2004 at 18:24, Adrian Wells wrote: Hi Paul, Thanks for your note, purely for interest... I found that using a call to my function worked perfectly if I used it once. If I called it more than once (on the same page), with data for different tables, it would correctly delete all existing references as required (these are just linking tables) but added all subsequent data to the first table referenced even though I could print the correct table name for each call! Using any of the calls to my function singly (slashing out the others) worked fine. I'd wasted so much time with the square braces fiasco that I decided to do the updates in-line and they worked fine first time! Maybe it's a machine issue, although I've seen no other problems and it serves the pages plenty quick enough for our needs. Our LAMP is using everything as standard (may have on-line updates) from the SuSE 9.0 disks on a Dell P2 266 optiplex with 96MB (?) and a 2GB HDD Since PHP 5.0.1 has been released, I'll not bother to report it as a bug - but it did help loosen a little more hair :-) Kind regards Adrian
I thought PHP was supposed to be thread-safe? The only circumstances under which there is believed to be issues is Apache2, but most people I've spoken to who use Apache 2 in their LAMP servers haven't reported any issues at all.
On 26 Aug 2004 at 16:05, adrian.wells wrote:
Hi Adrian
When using multiple select boxes you have to append the name of the select element with [] so PHP know to expect/convert it to an array.
so you example would need to be <select name="dcdrom[]" size="3" multiple id="dcdrom">
$_POST['dcdrom'] will now be an array
Thanks Matt :-)
Having looked over some examples again, I see that now but missed it before! (But you'd be amazed how many typo's there are out there. I don't understand why people don't copy and paste).
It now returns "array" :-)
Many Many thanks :-)
As an aside, I was unable to edit the data via a subroutine, although I was able to show that the correct data was being passed/processed, it just trashed the data, wierd! but if I did the updates in-line no problem! Maybe it has something to do with threads within PHP Version 4.3.3 ? Anyway all fixed now and I'm grinning again :-)
Three days messing about, all for a pair of square braces!
Kind regards Adrian
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com
----- Paul Graydon Network Technician Haywards Heath Sixth Form College http://www.hhc.ac.uk (01444) 456281
In the end, we will remember not the words of our enemies, but the silence of our friends. - Martin Luther King Jr. (1929 - 1968)
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com ----- Paul Graydon Network Technician Haywards Heath Sixth Form College http://www.hhc.ac.uk (01444) 456281 In the end, we will remember not the words of our enemies, but the silence of our friends. - Martin Luther King Jr. (1929 - 1968)
participants (3)
-
Adrian Wells
-
adrian.wells
-
Paul Graydon