I have a have rented a server at www.unoeuro.com (I dont know if this matters) When i submit the form it gives me "HTTP Error 405.0 - Method Not Allowed"
<?php
define('DB_NAME', '');
define('DB_USER', '');
define('DB_PASSWORD', '');
define('DB_HOST', '')
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$link) {
die('Could not connect: ' .mysql_error());
}
$db_selected = mysql_slect_db(DB_NAME, $link);
if (!$db_selected) {
die('Could not connect: ' .mysql_error());
}
$value = $_POST['username'];
$sql = "INSERT INTO test (username) VALUES ('$value')";
if (!mysql_query($sql)) {
die('Error: ' . mysql_error());
}
mysql_close();
?>
<!doctype HTML>
<form action="test.php" method="post">
<p>Username: <input type="text" name="username" /><p>
<input type="submit" value="Submit" />
</form>
Can anyone tell me what i am doing wrong? Just ask me for screenshots of anything you can use to help!
Sorry if the issue is obvious. This is my first time working with any kind of database, PHP and such.
Thanks!