So, quite proud I have to say, I managed to get up a textbox which updates a field in the database with what's entered and show this value. However, whenever I press submit, only the values I had before the edit are there and to get the new text, I need to refresh it again. I don't know why that is, so I thought I'd ask here.
Like I said, it does update the table in the database, it just doesn't immediately then show the new value... Also, when I click onto the page from another, the textfield doesn't automatically load the text and show it in the field... I have to reload it for that. Here's the code:
<?php
session_start();
include_once("include.inc.php");
incHeader();
// make sure staff only are here
newbouncer(2);
// include forum code
include_once("forum-code.php");
mysql_query("UPDATE online SET location = 'My Preferences' WHERE userid = '" . $userID . "'") or die(mysql_error());
$NOTE = mysql_query("SELECT note FROM notepad") or die(mysql_error());
$NOTE = mysql_fetch_object($NOTE);
mysql_query("UPDATE notepad SET note = '$_POST[note]' WHERE id = '1'") or die(mysql_error());
echo "</span></p>
</span>
<center><img src=\"/layout/images/notepad.png\"></center><p>
";
?>
<center><form action="/notes.php" method="post">
<textarea name="note" id="note" style="width:380px;height:481px; padding:50px ;background:url('http://i686.photobucket.com/albums/vv221/LilyLoganBing/scrollnotes.png'); border:1px #000000">
<?php
echo "$NOTE->note";
?>
</textarea><br>
<input type="submit" value="Submit"></center>
<?php
incFooter();
?>