Save to mysql and show text while typing onkeypress
keyj.php:
<input id='k'></input>
<script type="text/javascript">
document.getElementById('k').onkeypress=function()
{
<?php
$db=new PDO('mysql:host=localhost;dbname=test;charset=utf8 ','$us','$ps');
$db->exec("UPDATE TXT SET texts=k.value");
$rl=$db->query("SELECT texts FROM TXT");
print_r($rl->fetchColumn());
?>
}
</script>
The intention is to have text on the screen via print_r. I successfully used it in another php to exchange information with MySQL and users screen (worked).
Here - the more you type and the more k.value is the more text will be on screen (just from server).
Unfortunately something went wrong.
Read my Wordpress Tutorials
Get Free WordPress setup offer
Read SFDC Beginner Tutorials