Append to Article Body
var obj = document.getElementById('body'); obj.value = obj.value+"SOME TEXT";
11442 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
var obj = document.getElementById('body'); obj.value = obj.value+"SOME TEXT";
/* also - custom-1, custom-2, custom-3, custom-4, custom-5, etc for custom fields. */ var obj = document.getElementById('custom-3'); obj.value = "VALUE";
<html> <head> <link href="/textpattern/textpattern.css" rel="Stylesheet" type="text/css" /> </head> <body> <?php require_once("textpattern/config.php"); mysql_connect($txpcfg['host'], $txpcfg['user'], $txpcfg['pass']) or die(mysql_error()); mysql_select_db($txpcfg['db']) or die(mysql_error()); // Quote variable to make safe function quote_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = mysql_real_escape_string($value); } return $value; } $sql = "SELECT * FROM " .$txpcfg['table_prefix'] ."txp_log WHERE host LIKE '%" .quote_smart($_GET['host']) ."%' ORDER BY 'time' DESC LIMIT 0, 30 "; $result = mysql_query($sql) or die(mysql_error()); echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" id=\"list\" align=\"center\">"; echo "<tr><td><b>Time</b></td><td><b>host</b></td><td><b>page</b></td></tr>"; while($row = mysql_fetch_array($result)) { echo "<tr><td>".$row['time']."</td><td>".$row['host']."</td><td>".$row['page']."</td></tr>"; } echo "</table>"; ?> </body></html>