This question is almost 10 years old, but I never saw this.
If you are using HostGator, do the following:
go to cPanel –> MySQL Databases –> Add New User (set the password, and allow all or none of the query permissions – if you are a student then allow all permissions).
Now scroll down to "Add User To Database." Make sure the username you just created is linked to the database you are trying to use.
Here's a sample of how your code should look like:
// Server conditional values and connection
// This first if-statement connects to your localhost
if ($_SERVER['HTTP_HOST'] == 'localhost') {
define('HOST', 'localhost');
define('USER', 'root');
define('PASS', '1550');
define('DB', 'webPoll');
} else {
// Means that you are in a web server
define('HOST', 'localhost');
// localhost is the default parameter
define('USER', 'kevin69_tacoUser');
// add the username you just created
define('PASS', 'hUIDnd193');
// password for such username
define('DB', 'kevin69_webPoll');
// username_database
}
$conn = mysqli_connect(HOST, USER, PASS, DB);
Hope this helps someone out there!
<!-- SHTML Wrapper - 500 Server Error -->in source code ? 2. Looks like<input type="image" value="Submit" id="submit"/>is not submitting the form. Try to use<input type="submit">instead.