I have the following code, and I need to make the following words/code to be translated into the code provided in the bottom. THANKS GUYS.
If you press submit UPDATE authorize SET LockStatus ='LOCKED' WHERE ='$_SESSION['user_name'])'. Else - Select LockStatus from authorize is = to LOCKED show <input type="submit" value="Edit" disabled="disabled" /> Else If - Select LockStatus from authorize is not equal to LOCKED, then show <input type="submit" value="submit" name="submit">
PHP Code:<?php
$db_host = "localhost";
$db_user = "lefteh";
$db_pwd = "1234";
$db_name = "MyDB";
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name);
?>
<html>
<head>
<title>My first MySQL form submission</title>
</head>
<body>
<?php
if (!isset($_POST['submit'])) {
?>
<form action="" method="post">
Name: <input type="text" name="name"><br>
Favorite Color: <input type="text" name="color"><br>
<input type="submit" name="submit" value="Submit!">
</form>
<?php
} else {
$name = $_POST['name'];
$color = $_POST['color'];
mysql_query("INSERT INTO `colors` (name, favoriteColor) VALUES ('$name', '$color')");
echo "Success! Your favourite colour has been added!";
}
?>
</body>
</html>








Bookmarks