elfz Posted March 17, 2008 Report Share Posted March 17, 2008 No savas puses ieteikšu aši, kamēr neviens vēl nav tavu forumu nonesis, skriet mācīties par to, kā nodrošināt lietotāja nodotos parametrus, pirms viņus bāzt iekšā sql pieprasījumā. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 17, 2008 Report Share Posted March 17, 2008 mysql_query("DELETE * FROM vestules WHERE id = '$vest_id'") or die(mysql_error());echo "DELETE * FROM vestules WHERE id = '$vest_id'"; } shadi ir gruti ,un brizjam pilnigi bezjedziigi debuugot.. jo tu 2 reizes Duble to Kveriju... Ja 1 ielaidiisi Sintakses kljuudu , tad buus gruti to atrast.... --- $sql="SELECT * blaa..."; echo $sql; mysql_query($sql); --- Shadi buusi 100% parliecinats ka tas ir tas pats kas tiek padots DB ... Link to comment Share on other sites More sharing options...
anonīms Posted March 17, 2008 Author Report Share Posted March 17, 2008 Vēl saistīts ar šo skriptu, gribu izveidot check all f-ju, un mēģinu ar javascript, bet kaut kas nesanāk.. <script LANGUAGE="JavaScript"> function checkAll(field) { for (i = 0; i < field.length; i++) field[i].checked = true; } function uncheckAll(field) { for (i = 0; i < field.length; i++) field[i].checked = false; } </script> <input type='checkbox' value='".$sanemtaas['0']."' name='id[]'/> <input type=\"button\" name=\"Check All\" value=\"Ieķeksēt visu\" onClick=\"checkAll(document.vestules_visas.id[])\"> <input type=\"button\" name=\"UnCheckAll\" value=\"Atķeksēt visas\" onClick=\"uncheckAll(document.myform.list)\"> Kas tur ir nepareizs? Link to comment Share on other sites More sharing options...
Aleksejs Posted March 17, 2008 Report Share Posted March 17, 2008 Nesanāk kaut kas vai tomēr konkrēta lieta? Ko saka JavaScript debugeris? Link to comment Share on other sites More sharing options...
anonīms Posted March 17, 2008 Author Report Share Posted March 17, 2008 (edited) Caur validatoru saka, ka there is no attribute "LANGUAGE". document.myform has no propertiesonclick(click clientX=0, clientY=0)vestules (line 1) [break on this error] vestules (line 1) syntax error Edited March 17, 2008 by anonīms Link to comment Share on other sites More sharing options...
Val Posted March 17, 2008 Report Share Posted March 17, 2008 (edited) language="javascript" => type="text/javascript" <script type="text/javascript"> function select(a) { var theForm = document.myForm; for (i=0; i<theForm.elements.length; i++) { if (theForm.elements[i].name=='mycheckbox[]') theForm.elements[i].checked = a; } } </script> <form name="myForm"> <input type="checkbox" name="mycheckbox[]" value="somevalue1" /><br/> <input type="checkbox" name="mycheckbox[]" value="somevalue2" /><br/> <input type="checkbox" name="mycheckbox[]" value="somevalue3" /> </form> <a href="java script:select(1)">Check all</a> | <a href="java script:select(0)">Uncheck all</a> Edited March 17, 2008 by Val Link to comment Share on other sites More sharing options...
anonīms Posted March 17, 2008 Author Report Share Posted March 17, 2008 Val theForm has no propertiesselect(1)vestules (line 21) [break on this error] for (i=0; i<theForm.elements.length; i++) { Link to comment Share on other sites More sharing options...
Val Posted March 17, 2008 Report Share Posted March 17, 2008 parādi uzģenerēto html Link to comment Share on other sites More sharing options...
anonīms Posted March 17, 2008 Author Report Share Posted March 17, 2008 (edited) <script type="text/javascript"> function select(a) { var theForm = document.myForm; for (i=0; i<theForm.elements.length; i++) { if (theForm.elements[i].name=='id[]') theForm.elements[i].checked = a; } } </script> <input type='checkbox' value='".$sanemtaas['0']."' name='id[]'/> <form method=\"POST\" name=\"theForm\"> .............. <a href=\"java script:select(1)\">Ieķeksēt visas</a> | <a href=\"java script:select(0)\">Izķeksēt visas</a> ................... Edited March 17, 2008 by anonīms Link to comment Share on other sites More sharing options...
Val Posted March 17, 2008 Report Share Posted March 17, 2008 tu pat formas nosaukumu nevari samainīt... un kāpēc eskeipo pēdiņas formā? visu to kluci laid caur php? Link to comment Share on other sites More sharing options...
anonīms Posted March 17, 2008 Author Report Share Posted March 17, 2008 Opā, paldies :] Tiešām form name bija cits. Jā, viss iet caur php Link to comment Share on other sites More sharing options...
anonīms Posted March 17, 2008 Author Report Share Posted March 17, 2008 Vēl nedaudz pie šī skripta foreach($_POST["id"] as $vest_id) { mysql_query("DELETE FROM vestules WHERE id = '$vest_id'"); } <input type='submit' value='Dzēst atzīmētās vēstules' /> Kā input pogu varētu pārveidot par parastu linku? Link to comment Share on other sites More sharing options...
Val Posted March 17, 2008 Report Share Posted March 17, 2008 minēšu. pēdējais koda gabals neatrodas starp form tagiem Link to comment Share on other sites More sharing options...
anonīms Posted March 18, 2008 Author Report Share Posted March 18, 2008 Kapēc neatrodas? atrodas! Un tas 'Dzēst vēstules' inputs strādā, tikai negribu, lai viņš būtu inputs, bet links. Link to comment Share on other sites More sharing options...
Recommended Posts