Nezinītis Posted March 23, 2010 Report Share Posted March 23, 2010 Sveiki. Again my forums. Pievienoju funkciju - rediģēt tēmas. Atverot jaunu lapu, izdaru visu nepieciešamo [izselektēju datus, apstrādāju, utt.] Viss ok ar standarta <input> laukiem, bet <textarea> dati netiek ievietoti - $tqq=mysql_query("SELECT * FROM themes WHERE id=".S($t_id)) or die (mysql_error()); $data1 = mysql_fetch_array( $tqq ); echo ' Rediģēt tēmu:<br /> ------------------------------------------ <form name="input" action="/addtheme/" method="post"> Tēmas nosaukums:<br /> <input type="text" name="t_name" value="'.$data1['t_name'].'" size="20" /><br /> Tēmas autors:<br /> <input type="text" name="t_author" value="'.$data1['t_author'].'" size="20" /><br /> Tēmas saturs: <br /><textarea value="'.$data1['t_content'].' id="t_content" tabindex="3" rows="10" cols="50%" name="t_content"" ></textarea><br /> <br /><input type="submit" value="Apstiprināt" /> </form> <form> <input type="submit" value="Atcelt" action=""> '; Quote Link to comment Share on other sites More sharing options...
mickys Posted March 23, 2010 Report Share Posted March 23, 2010 <textarea>$content</textarea> Quote Link to comment Share on other sites More sharing options...
mounkuls Posted March 23, 2010 Report Share Posted March 23, 2010 (edited) <textarea value="'.$data1['t_content'].' id="t_content" tabindex="3" rows="10" cols="50%" name="t_content"" ></textarea> Tev value skaitās viss šis te-> '.$data1['t_content'].' id=. Šo t_content"nezinu kā pārlūks uztvers. Un galā tās 2 pēdiņas arī ej nu sazini. Edited March 23, 2010 by mounkuls Quote Link to comment Share on other sites More sharing options...
Nezinītis Posted March 23, 2010 Author Report Share Posted March 23, 2010 nu jā, šādi - Tēmas saturs: <textarea id="t_content" tabindex="3" rows="10" cols="50%" name="t_content" >'.$data1['t_content'].'</textarea> Mounkuls, šeit sintakse ir pareiza value="'.$data1['t_content'].' ' - atgrieztos atpakaļ php, jo visu html kodu lieku caur echo '';, citādi php to visu uztvers kā tekstu, ja nebūtu '. .' . Quote Link to comment Share on other sites More sharing options...
mounkuls Posted March 23, 2010 Report Share Posted March 23, 2010 Kur Tev tā sintakse tur pareiza, ja value ir vis kas iekš pēdiņām skaitās? Kur noslēdz value="'.$data1['t_content'].'? Ko?:) Quote Link to comment Share on other sites More sharing options...
Nezinītis Posted March 23, 2010 Author Report Share Posted March 23, 2010 php.lv forumu kļūda, kopējot kodu iekšā, pazuda value aiztaisošās pēdiņas. :D Quote Link to comment Share on other sites More sharing options...
mounkuls Posted March 23, 2010 Report Share Posted March 23, 2010 Un dubultas uzmeta vēl beigās ...name="t_content"" >vai ne?:) Quote Link to comment Share on other sites More sharing options...
Nezinītis Posted March 23, 2010 Author Report Share Posted March 23, 2010 Ehhh, šis php.lv forums, galīgi sahakots. :D Quote Link to comment Share on other sites More sharing options...
krikulis Posted March 23, 2010 Report Share Posted March 23, 2010 (edited) !!!Variaabljus eskeipot ar HtmlSpecialChars() Like $tqq=mysql_query("SELECT * FROM themes WHERE id=".S($t_id)) or exit; $data1 = mysql_fetch_assoc($tqq); echo ' Rediģēt tēmu:<br /> <form name="input" action="/addtheme/" method="post"> Tēmas nosaukums:<br /> <input type="text" name="t_name" value="'.htmlspecialchars($data1['t_name']).'" size="20" /><br /> Tēmas autors:<br /> <input type="text" name="t_author" value="'.htmlspecialchars($data1['t_author']).'" size="20" /><br /> Tēmas saturs: <br /><textarea id="t_content" tabindex="3" rows="10" cols="50%" name="t_content"" >' . htmlspecialchars($data1['t_content']) . '</textarea><br /> <br /><input type="submit" value="Apstiprināt" /> </form> <form> <input type="submit" value="Atcelt" action=""> '; Edited March 23, 2010 by krikulis Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.