marlboro Posted October 21, 2008 Author Report Share Posted October 21, 2008 un ka pareizi buutu jadefine shi funkcija ? Link to comment Share on other sites More sharing options...
andrisp Posted October 21, 2008 Report Share Posted October 21, 2008 Pameklē php.net pēc tā nosaukuma un sapratīsi. Link to comment Share on other sites More sharing options...
blackhalt Posted October 21, 2008 Report Share Posted October 21, 2008 Laikam ins_array vietā domāts in_array Link to comment Share on other sites More sharing options...
marlboro Posted October 21, 2008 Author Report Share Posted October 21, 2008 ok ok pats atradu ... sory par stulbu jautajumu baisi saguris esu .. Link to comment Share on other sites More sharing options...
Java Posted October 21, 2008 Report Share Posted October 21, 2008 Oi sorry par to ins_array - neuzmanības kļūda bija jābūt in_array - bet kā - sanāca? Link to comment Share on other sites More sharing options...
Java Posted October 21, 2008 Report Share Posted October 21, 2008 Galējais kods varētu būt sekojošs: <?php $select_opts = array(1,2); if ($_REQUEST['saturs']) $saturs = (int)$_GET['saturs']; else $saturs = 0; if (!in_array($saturs, $select_opts)) $saturs = 0; ?> <form name="form_select_content" method="get" id="form_select_content"> Izvelies lapu : <select name="saturs" onchange="document.forms['form_select_content'].submit();"> <option value="0"<?php if ($saturs==0) echo ' selected';?>></option> <?php foreach ($select_opts as $val) { echo '<option value="'.$val.'"' . ($saturs==$val ? ' selected' : '') . '>saturs '.$val.'</option>'; } ?> </select> </form> <form name="form_main" method="post" action="updatePage.php"> <br><textarea rows="10" cols="60" name="contents"> <?php if($saturs == 1){ echo "$contents"; }else{ echo "nau!!"; } ?> </textarea> <input type="submit" name="Submit" value="Saglabat"> </form> Link to comment Share on other sites More sharing options...
Recommended Posts