lundi 27 avril 2015

Error while submitting php form with aws database

<?php

define ('DB_NAME', '');
define ('DB_USER', '');
define ('DB_PASSWORD', '');
define ('DB_HOST', '');

$connect = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);

if (!$connect) {
die('Could not connect: ' . mysql_error());
}

$dv_selected = mysql_select_db(DB_NAME, $connect);

if (!$db_selected) {
die('Can\'t use ' . DB_NAME . ': ' . mysql_error());
}

$sql = "INSERT INTO client (Name, Email, Question) VALUES ('$_POST['Name']',                  '$_POST['Email']', '$_POST['Question']')";

if (!mysql_query($sql)) {
die('Error: ' . mysql_error());
}

echo 'Connected successfully';

mysql_close();
?>

This is my php file but each time I try to send inofrmation to the database using this link!

"The specified method is not allowed against this resource."

If you try this out you will see I get an error when trying to post..




Aucun commentaire:

Enregistrer un commentaire