messer Posted April 13, 2009 Share Posted April 13, 2009 Hi to everyone, I'm a novice in php,and currently working in php4. I got a problem and can not find solution. Please to help me to solve it... :'( Here is the code: <?php session_start(); include("dbinfo.php"); if(!isset($_GET['action'])) $_GET['action']=''; switch($_GET['action']) { case '': $_SESSION['bonid']=$_GET['bonid']; $_SESSION['numer']=$_GET['numer']; $query="SELECT * FROM bon WHERE BonID='".$Row['ID']."'"; // $Row['ID'] from another select $result_bon=mysql_query($query); echo' <form name="form1" method="post" action="this_page.php?action=update&id='.$_SESSION['bonid'].'" enctype="multipart/form-data"> <table width=100% border=0 cellpadding=1 cellspacing=1 bgcolor="#ffffff">'; while($Row_bon=mysql_fetch_array($result_bon)) { $i++; $query_art="SELECT * FROM artikles WHERE ArtID='".$Row_bon['ArtikleID']."'"; $result_art=mysql_query($query_art); $Row_art=mysql_fetch_array($result_art); echo '<tr> <td class="xxx" >'.$i.'</td> <td class="xxx" ><input name="art[]" type="checkbox" value='.$Row_art['ArtID'].'></td> <td class="xxx" >'.$Row_art['ArtNumer'].'</td> <td class="xxx" >'.$Row_art['ArtDescription'].'</td> <td class="xxx" ><input name="total[]" type="text" value='.$Row_bon['ArtTotaal'].' size=6></td> <td class="xxx" >€ '.$Row_bon['ArtPrice'].'</td> <td class="xxx" >'.$Row_bon['ArtBTW'].'%</td> <input name="price[]" type="hidden" value='.$Row_bon['ArtPrice'].'> //Here i putted two hidden inputs to be able to move the value(price and btw) from this case to next one <input name="btw[]" type="hidden" value='.$Row_bon['ArtBTW'].'> </tr>'; } echo'</table> </br> <div align="center"><input name="submit" type="submit" value=" Next " /><div> </form>'; break; case 'update': if(!isset($_POST['total'])) $_SESSION['total'] = ''; else $_SESSION['total'] = $_POST['total']; if(!isset($_POST['art'])) $_SESSION['art'] = ''; else $_SESSION['art'] = $_POST['art']; if(!isset($_POST['price'])) $_SESSION['price'] = ''; else $_SESSION['price'] = $_POST['price']; if(!isset($_POST['btw'])) $_SESSION['btw'] = ''; else $_SESSION['btw'] = $_POST['btw']; $_SESSION['bonid']=$_GET['id']; $_SESSION['numer']=$_GET['numer']; .... And here is my problem, I have in previous case at least 5-6 rows with different artikles and inputs with price, and i check for example only the 1st and 4th artikle, and don't know how to get all those values that from row 1 and 4 (a checkbox and inputs ... I'm sorry for my English, and i would appreciate if anyone could help me. Link to comment https://forums.phpfreaks.com/topic/153920-problems-with-moving-data-from-one-case-to-over/ Share on other sites More sharing options...
messer Posted April 14, 2009 Author Share Posted April 14, 2009 Please someone to give an advice... Link to comment https://forums.phpfreaks.com/topic/153920-problems-with-moving-data-from-one-case-to-over/#findComment-809373 Share on other sites More sharing options...
MasterACE14 Posted April 14, 2009 Share Posted April 14, 2009 I don't understand what your question is? Link to comment https://forums.phpfreaks.com/topic/153920-problems-with-moving-data-from-one-case-to-over/#findComment-809383 Share on other sites More sharing options...
messer Posted April 14, 2009 Author Share Posted April 14, 2009 I'm generating a table, with more than 5 rows, each row contains a checkbooks, and 3-4 <input>, and for example: - i want to check only row 1 and 3; when i press next its generating another table with values from checkbox 1 and 3(everything it's fine),but values from <input> 1 and 2... now you understand my problem? Link to comment https://forums.phpfreaks.com/topic/153920-problems-with-moving-data-from-one-case-to-over/#findComment-809393 Share on other sites More sharing options...
messer Posted April 14, 2009 Author Share Posted April 14, 2009 is there anyone that could help me???? Link to comment https://forums.phpfreaks.com/topic/153920-problems-with-moving-data-from-one-case-to-over/#findComment-809488 Share on other sites More sharing options...
MasterACE14 Posted April 14, 2009 Share Posted April 14, 2009 should change this... case '': to... default: otherwise I don't think that part will ever be executed. Link to comment https://forums.phpfreaks.com/topic/153920-problems-with-moving-data-from-one-case-to-over/#findComment-809498 Share on other sites More sharing options...
messer Posted April 14, 2009 Author Share Posted April 14, 2009 everything it's working... the problem is that when i press NEXT in the over case' ': are formatted 6 arrays: from "checkbox" : - $_session['var'][0](id from first row) and [1](id from the 3rd row) ((because i've selected only 2 checkboxes)) but from the rest : -$_session['var+'][0] (id from first row) -$_session['var+'] [1] (id from second row) -$_session['var+'][2] -$_session['var+'][3] -$_session['var+'][4] I've tried " foreach" and it doesn't arrange correctly Link to comment https://forums.phpfreaks.com/topic/153920-problems-with-moving-data-from-one-case-to-over/#findComment-809571 Share on other sites More sharing options...
messer Posted April 14, 2009 Author Share Posted April 14, 2009 Please someone to help !!! Link to comment https://forums.phpfreaks.com/topic/153920-problems-with-moving-data-from-one-case-to-over/#findComment-809742 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.