Jump to content
php.lv forumi

Atgriezt vērtību iekš <textarea>


Nezinītis

Recommended Posts

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="">	'; 

Link to comment
Share on other sites

<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 by mounkuls
Link to comment
Share on other sites

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 '. .' .

Link to comment
Share on other sites

!!!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 by krikulis
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...