What's wrong with this code, some strings are on config.php
PHP Code:
<?php
include('config.php');
$submit = $_POST['submit'];
$host = "localhost";
$user = "root";
$pass = "123";
$database = "jacksphp";
$date = date('Y-d-m');
$message = $_POST['message'];
$connect = mysql_connect('localhost','root','123') or die('MySQL couldnt connect!');
mysql_select_db('jacksphp') or die(' Couldnt connect to database!');
if ($submit)
{
if ($_POST['on'])
$status = $_POST['on'];
else
{
$status = $_POST['off'];
$query = mysql_query("UPDATE notice SET message='$message' status='$status' date='$date' WHERE id='1'");
echo "Updated!";
}
}
else
{
echo '
<form action="edit.php" method="POST">
<table border="0">
<tr>
<td><input type="checkbox" name="on" value="On"> <u>Message On</u> </td></tr><br />
<tr><td><input type="checkbox" name="off" value="Off"> <u>Message Off</u></td> <br />
</tr>
<tr>
<td><textarea name="message" cols="25"></textarea> </td>
</tr>
</table>
<input type="submit" name="submit">
<form>
';
}
?>





Reply With Quote






