I'm currently trying to make an html community. I've ran into some problem.
<?
$link = mysql_connect('localhost','chaotici_commu', '')
or die("Could not connect");
mysql_select_db('chaotici_chaotic')
or die("Could not select database");
$result = MYSQL_QUERY("SELECT username from users WHERE username='$username'") or die ("Name and password not found or not matched");
$worked = mysql_fetch_array($result);
$user = $worked[username];
if(!isset($_COOKIE['LoggedIn'])) die("You are not logged in!");
$insert ="INSERT INTO users (html)
VALUES ('".$_POST['edithtml']."')";
mysql_query($insert) or die ("Could not add data to the table");
?>
THis is the form i'm using right now the html textarea.
<form action="edithp.php" method="post">
<div align="center">
<textarea name="edithtml" type="text" cols="60" rows="20" wrap="virtual" id="edithtml">
<!-- Do not remove meta tags
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
-->
</textarea>
<input name="Submit" type="submit" value="Update" class="buttons">
<input type="reset" name="reset" value="Undo" class="buttons">
</div>
</form>
I'm able to type in something and store it in the database. The thing is I want it to be in the users that is logged in to be able to put his html code in, but when ever I post the html code it inserts a new row. Instead of the same user that is currently updating his/hers html stuff. I want to know how you can insert a data in the certain user(s) that is logged in. PLease help anyone.🙂 🙂 🙂 🙁