I have a form on another webpage, and I am sure that it is working.
The problem is that, in the following code, I am using the variable $text to update the MySQL. And, when the user submits, the value will not update unless I actually create a specific value to set.
Please excuse the terrible coding. I just want to make it functional before I organize/secure it.
Any help is appreciated, thanks

- Code: Select all
<?PHP
session_start();
function upload() {
$text = $_POST['description'];
$userid = $_SESSION['user_id'];
$con = mysql_connect("localhost","**********","****"); //I starred these on purpose
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("1043896_db", $con);
mysql_query("UPDATE users SET description=$text
WHERE user_id=$userid");
}
if (isset($_POST['submit'])) {
upload();}
?>



