Results 1 to 25 of 67
Thread: .
Hybrid View
-
22nd February 2009 01:51 #1
.
. . - , - "" "", . :
:HTML Code:<input name="object[$id]" type="checbox" value="1">
, , - .. "" "" PHP, , 0 . - "" "1" Id-, , "0", Id objectId. :PHP Code:<?php
foreach($_POST["object"] as $objectId => $objectValue) {
// MySQL , objectId .
}
?>
... , , , .PHP Code:@mysql_query("UPDATE ".TABLE_PREFIX." SET `Active` = '1' WHERE `Id` = '".$objectId."'") or die(mysql_error());
@mysql_query("UPDATE ".TABLE_PREFIX." SET `Active` = '0' WHERE `Id` <> '".$objectId."'") or die(mysql_error());
-
22nd February 2009 02:14 #2
, . , , POST-a. , . , , - . , .
, , checkbox_1, checkbox_2 .. POST , - checkbox_. , , , .EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|
-
22nd February 2009 11:06 #3
Bombera , ! .
, -, - , .
.
, zOne , .. .
, Bombera. ID-, , , , , -, , . JS-a.Last edited by tedych; 22nd February 2009 at 11:17.
-
22nd February 2009 12:45 #4
, , , -.
EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|
-
22nd February 2009 23:08 #5
-
23rd February 2009 00:32 #6
:
ID-, , - , . . , - id_arr .Code:<? if(isset($_REQUEST['submit'])) { die(print_r($_REQUEST)); } else { ?> <form method="post" action=""> offer1 <input type="hidden" name="id_arr[]" value="1"> <input type="checkbox" name="checked_arr[]" value="1" /> <br/> offer2 <input type="hidden" name="id_arr[]" value="2"> <input type="checkbox" name="checked_arr[]" value="2" /> <br/> offer3 <input type="hidden" name="id_arr[]" value="3"> <input type="checkbox" name="checked_arr[]" value="3" /> <br/> offer4 <input type="hidden" name="id_arr[]" value="4"> <input type="checkbox" name="checked_arr[]" value="4" /> <br/> offer5 <input type="hidden" name="id_arr[]" value="5"> <input type="checkbox" name="checked_arr[]" value="5" /> <br/> <input type="submit" name="submit" value="Send" /> </form> <? } ?>
id_arr checked_arr.
, - .. id_arr, checked_arr ( "/" , - ).
, , "IN ()" ( , ) . .
-
23rd February 2009 07:53 #7
-
23rd February 2009 10:14 #8
-, - .
, +ID:
Code:function convert_checks($pre){ $arrpost=$_POST; while(list($a,$b)=each($arrpost)){ if($b=='true' && eregi("$pre",$a)){ $a=str_replace("$pre","",$a); echo "checkbox ".$a."is checked"; }else { echo "checkbox ".$a."is NOT checked"; } } }Hey, mother, I come bearing a gift. I'll give you a hint. It's in my diaper and it's not a toaster.
.
-
23rd February 2009 15:27 #9
? ?! , . , .
, , .EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|
-
24th February 2009 02:09 #10
-
24th February 2009 11:08 #11
-
24th February 2009 13:48 #12
-
24th February 2009 14:33 #13
-
24th February 2009 01:11 #14
-
24th February 2009 09:54 #15
-
24th February 2009 22:00 #16
- . -. ID chb+ . user-a . -. 0 (.. unchecked). , . - User - Server , , => . , - CPU Load ( ASP.NET).
-
24th February 2009 22:18 #17
,
.
Nevermore, , ID- . , -
.
, ,
foreach ($exploded as $id)
$values[$id] = isset($_POST['prefix_'.$id]);
-
24th February 2009 22:36 #18, ?PHP Code:
<form method="post">
<input type="hidden" name="id_arr[11]" value="11"> <input type="checkbox" name="prefix_11" value="11" />
<input type="hidden" name="id_arr[12]" value="12"> <input type="checkbox" name="prefix_12" value="12" />
<input name="send" type="submit" value="ADD"/>
</form>
<?php
$exploded = explode(",", $_POST["id_arr"]);
foreach ($exploded as $id => $values)
$values[$id] = (isset($_POST['prefix_'.$id])) ? true: false;
?>
-
24th February 2009 22:45 #19
:
Code:<form method="post"> <input type="hidden" name="id_arr" value="11,12,20"> <input type="checkbox" name="prefix_11" value="1" /> <input type="checkbox" name="prefix_12" value="1" /> <input type="checkbox" name="prefix_20" value="1" /> <input name="send" type="submit" value="ADD"/> </form>
$values , ID- (.. , ), ID , true/false, .Code:<?php $exploded = explode(",", $_POST["id_arr"]); foreach ($exploded as $id) $values[$id] = isset($_POST['prefix_'.$id]); ?>
-
24th February 2009 23:01 #20
ID-, . value- . . foreach count($id_arr).
, , . POST, , - . prefix_ __ prefix___.
. - , . , .
PHP Code:<?
$count = count($id_arr);
$index = 1;
foreach($id_arr as $value){
/?>
<input type="checkbox" name="prefix_<? echo $index; /?>" value="<? echo $value; /?>">
<?
$index++;
}
/?>
<input type="hidden" name="items_count" value="<? echo $count; /?>">! value . , .PHP Code:$index = 0;
foreach($_POST as $key=>$value){
if(strpos($key, 'prefix_') === 0)
$items[$index] = $value;
$index++;
}
/* items, $_POST['items_count']. , $_POST['items_count'], false foreach.
:*/
for($i = 0; $i < $_POST['items_count']; i++){
if(isset($items[$i]))
echo $items[$i]
else
echo " $i ";
}
( ) .Last edited by Bombera; 24th February 2009 at 23:38.
EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|
-
24th February 2009 23:06 #21
. .
tedych , !PHP Code:<form method="post">
<input type="hidden" name="id_arr" value="11,12,20">
<input type="checkbox" name="prefix_11" />
<input type="checkbox" name="prefix_12"/>
<input type="checkbox" name="prefix_20"/>
<input name="send" type="submit" value="ADD"/>
</form>
<?php
$exploded = explode(",", $_POST["id_arr"]);
foreach ($exploded as $id) {
$values[$id] = (isset($_POST['prefix_'.$id])) ? "yes": "no";
echo $values[$id] . " - " . $id . "<br/>";
}
?>Last edited by z0ne; 24th February 2009 at 23:17.
-
24th February 2009 23:26 #22
, ID-, , , IDENTITY - , .
- , POST , , -
. , , 100 , 600 ( 5- ) - , , Bombera.
-
24th February 2009 23:51 #23
-
24th February 2009 23:56 #24
. , ,
- . .
, - 100 , . !
EVGA X299 FTW K|i9-7960X@4.7|4x8 Patriot Viper Steel 4000|GTX 1660 Ti|970 EVO 1 TB|Seasonic Focus GX-1000|Xigmatek Elysium|
Rampage IV Extreme BE|E5-1680v2@4.7|4x4 HyperX 1866|Cougar Aqua 240|GTX 1050 Ti|970 EVO 1/4 TB|CM 850 SilentPro|HAF-X|
-
25th February 2009 10:33 #25Registered User
Join Date: Jul:2005
Location: Sofiq
Posts: 2,798
? "". ID- . POST, :
UPDATE table SET active=0 WHERE ID IN(implode(",", $vsi4ki_id));
UPDATE table SET active=1 WHERE ID IN(implode(",", $cehcknati_id));




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in