I am trying to use isset($_POST['Save'])
in my php file to save result in database.
echo "<form action='' method='POST'>";
echo "<input name='Save' type='submit' value='Save Result'>";
echo "</form>";
if(isset($_POST['Save']))
{
include('saveResult.php');
}
saveResult.php:
<?php
if(isset($_POST['Save'])) // If the submit button was clicked
{
$serverName = "Alaa";
echo"saveResult function php";
$connectionInfo = array( "Database"=>"i2b2blast", "UID"=>"i2b2blast", "PWD"=>"demouser");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
$sql = "INSERT INTO BlastQueryDim (QueryID, QuerySeq) VALUES ('9', 'q')";
$stmt = sqlsrv_query( $conn, $sql);
if( $stmt === false ) {
die( print_r( sqlsrv_errors(), true));
}
}
?>
but, I got this error:
HTTP Error 405.0 - Method Not Allowed The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used. The request sent to the Web server used an HTTP verb that is not allowed by the module configured to handle the request. A request was sent to the server that contained an invalid HTTP verb. The request is for static content and contains an HTTP verb other than GET or HEAD. A request was sent to a virtual directory using the HTTP verb POST and the default document is a static file that does not support HTTP verbs other than GET or HEAD.
Any help please?