Page 1 of 3 123 LastLast
Results 1 to 25 of 67

Thread: .

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331

    .

    . . - , - "" "", . :

    HTML Code:
    <input name="object[$id]" type="checbox" value="1">
    :

    PHP Code:
    <?php
    foreach($_POST["object"] as $objectId => $objectValue) {

    //  MySQL ,  objectId    .

    }
    ?>
    , , - .. "" "" PHP, , 0 . - "" "1" Id-, , "0", Id 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()); 
    ... , , , .

  2. #2
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    , . , , 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|

  3. #3
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    Bombera , ! .
    , -, - , .
    .

    , zOne , .. .
    , Bombera. ID-, , , , , -, , . JS-a.
    Last edited by tedych; 22nd February 2009 at 11:17.

  4. #4
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    , , , -.
    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|

  5. #5
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    . . , - . ... . , 5, - 20, - 100.

  6. #6
    دارس وعامل Siemens's Avatar
    Join Date: Jul:2003
    Location:
    Posts: 1,576
    :
    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-, , - , . . , - id_arr .
    id_arr checked_arr.
    , - .. id_arr, checked_arr ( "/" , - ).
    , , "IN ()" ( , ) . .

  7. #7
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    . .

  8. #8
    hmm BornToDrink's Avatar
    Join Date: Aug:2005
    Location: .
    Posts: 11,573
    -, - .

    , +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.
    .

  9. #9
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    ? ?! , . , .
    , , .
    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|

  10. #10
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    Quote Originally Posted by Bombera View Post
    ? ?! , . , .
    , , .
    . - ID- , - . 10 .

  11. #11
    دارس وعامل Siemens's Avatar
    Join Date: Jul:2003
    Location:
    Posts: 1,576
    Quote Originally Posted by z0ne View Post
    . - ID- , - . 10 .
    - - , - .
    Bombera. .. , - .
    , , .

  12. #12
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    Quote Originally Posted by Siemens View Post
    - - , - .
    Bombera. .. , - .
    , , .
    , . . - "/" "redirect".

  13. #13
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    Quote Originally Posted by z0ne View Post
    , . . - "/" "redirect".
    "/"

  14. #14
    UnRegistered User Nevermore's Avatar
    Join Date: May:2007
    Location: Sofia
    Posts: 615
    , 0 ... 1 , postback-.

  15. #15
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , , , ID-, . .

  16. #16
    UnRegistered User Nevermore's Avatar
    Join Date: May:2007
    Location: Sofia
    Posts: 615
    - . -. ID chb+ . user-a . -. 0 (.. unchecked). , . - User - Server , , => . , - CPU Load ( ASP.NET).

  17. #17
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , .
    Nevermore, , ID- . , - .
    , ,
    foreach ($exploded as $id)
    $values[$id] = isset($_POST['prefix_'.$id]);

  18. #18
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    Quote Originally Posted by tedych View Post
    , .
    Nevermore, , ID- . , - .
    , ,
    foreach ($exploded as $id)
    $values[$id] = isset($_POST['prefix_'.$id]);
    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])) ? truefalse;
    ?>
    , ?

  19. #19
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    :


    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>

    Code:
    <?php
    $exploded = explode(",", $_POST["id_arr"]);
    foreach ($exploded as $id)
    $values[$id] = isset($_POST['prefix_'.$id]);
    ?>
    $values , ID- (.. , ), ID , true/false, .

  20. #20
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    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; /?>">
    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  ";

    ! value . , .
    ( ) .
    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|

  21. #21
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    Quote Originally Posted by Bombera View Post
    - , . , .
    . .

    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/>";
            
        }
    ?>
    tedych , !
    Last edited by z0ne; 24th February 2009 at 23:17.

  22. #22
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , ID-, , , IDENTITY - , .
    - , POST , , - . , , 100 , 600 ( 5- ) - , , Bombera.

  23. #23
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    Quote Originally Posted by tedych View Post
    , ID-, , , IDENTITY - , .
    - , POST , , - . , , 100 , 600 ( 5- ) - , , Bombera.
    Id- . Id- checbox-a. ... .

  24. #24
    Bombera's Avatar
    Join Date: Jul:2001
    Location: 4EVA
    Posts: 13,833
    . , , - . .
    , - 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|

  25. #25
    Registered 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));

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |