The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Insert multiple from input checkbox
#21
video here I have problem
  Reply
#22
Ok...How about this...

Code:
<input type='checkbox' name='utilizator[<?=permOp->id?>]' autocomplete='off' value='<?=$permOp->fname?>'>

So, then, when the form is submitted, you have both the person selected's id and fname.

So then you can process your form like...
Code:
if(!empty($_POST)){
Code:
foreach($_POST['utilizator'] as $key=>$value){
Code:
//run your DB insert for each untilizator here!
Code:
}
Code:
}

So when you are formulating your query in the example above $key is the id of the person whose box was checked. It is already in a foreach loop so if you do a query, it will do it for every single checked person. You can experiment by doing

Code:
foreach($_POST['utilizator'] as $key=>$value){
Code:
dump($key);
Code:
dump($value);
Code:
}
Code:
}
  Reply
#23
I posted a video to explain a little bit more. It will be live shortly.
https://youtu.be/Ls2NTY2mMHw
  Reply
#24
Thank you very much, It helps me a lot, especially how easily explain. now I understand how it works.

It worked, thank you very much, I am happy that it functioned Tongue
  Reply
#25
Awesome. Glad it helped. I also sent you an email from my mudmin account about css.
  Reply
#26
What email picassoo_2.....@yahoo ??
  Reply
#27
Yes. I guess check your spam?
  Reply
#28
Send again pleasee, I cant see the email from you Sad((
  Reply
#29
Ok!
  Reply
#30
For DAN

I have the update format, pleasee send me again your email pleasee. Sorry it took so long, but I changed my work from Operator printer tu web design and manager platform web. now I’m back, to help ?
  Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)