Messages - JoTo [ switch to compact view ]

Pages: prev1 ... 15 16 17 18 19 [20] 21 22 23 24 25 ... 46next
96
Developer's Corner / Re: What is wrong with this php-snippet?
« on: December 08, 2010, 05:12 AM »
HiHo,

glad you solved it and you were welcome!

Greetings
JoTo

97
Developer's Corner / Re: What is wrong with this php-snippet?
« on: December 08, 2010, 03:04 AM »
Hi again,

A LISTBOX, aha. I am not sure right out of the head how the single strings in a submitted listbox content are divided. Is it \n, \r, \r\n, < br />?

I think the problem is, that you need another split character in your explode (first parameter where i used the space character in my example - " ").

See first, whats exactly in your $_POST["vehicle"] variable contained (e.g. write the original $_POST variable to a file and use a hex viewer) and use the correct split character in explode.

Otherwise, what element do you use exactly in your html page? If you want, you can use a < select> element, which should deliver back a proper array with the selected items, ready to use with foreach without any exploding before.

For a sample look here:
http://www.onlinetools.org/tricks/using_multiple_select.php

HTH
JoTo

98
Developer's Corner / Re: What is wrong with this php-snippet?
« on: December 08, 2010, 02:38 AM »
Hi there,

i think the problem is, that foreach needs an array. While $_POST is indeed an array, $_POST["vehicle"] is NOT. It's normally a scalar, unless its a group of controls (e.g. checkboxes).

Either you use $_POST["vehicle"] without any loop (e.g. in that variable is contained "vehicleA vehicleB vehicleC" you'll get what you want without a loop but without the line breaks), or you do an explode before the loop like this (assuming the vehicles in that variable are divided by a space):

$arrTmp = explode(" ", $_POST["vehicle"]);
foreach($arrTmp as $value)
{
  // do what you want now with $value
}

You can test if $_POST["vehicle"] is an array or not with the function is_array(). If it's the result from e.g. checkboxes, it should work as you did. Then i'm out of ideas, sorry.

HTH
JoTo

99
@40Hz:
As i said, i dont have to hide military secrets, just want to prohibit a simple undelete. So i follow your advise and use the single DBAN pass.

Thank you too.

Greetings JoTo

100
Thanks merle, i'll look at that one too!

Greetings
JoTo

Pages: prev1 ... 15 16 17 18 19 [20] 21 22 23 24 25 ... 46next
Go to full version