Need Help with PHP + MySQL
I have been running into problems with this code for a bit now. Since I am just learning PHP, I decided that the best way to learn is to start building. So I got part of the script done, but ran into a problem adding data to a database.
I have a file called ADD dot php which looks like this:
and a file called addomain dot php that includes this
<?php include "base dot php"; ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="style dot css" type="text/css" />
<form method="post" action="addomain dot php" name="loginform" id="loginform">
<label for="domain">Domain:</label><input type="text" name="domain" id="domain" /><br /><br />
<input type="submit" name="submit" id="submit" value="Add Domain!" />
<a href="logout dot php">Logout</a>
But for some reason, I can't add whatever the user imput into the form into the database. Is there anything wrong with this? It gives me a syntax error like this
$first = $_POST['domain'];
$sql = "INSERT INTO (domains) VALUES ('$first')";
If anyone could help, I would really appreciate it.
Parse error: syntax error, unexpected $end in addomain dot php on line 6