1

I'm trying to write a short html page for input username and pwd in order to write some data in my local SQL Server. I can find the error in subject when submitting.

This is the html code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Form to SQL</title>
</head>
<body>
    <form method="post" action="send.php">
        Username: <input type="text" name="username">
        <br>
        Password: <input type="text" name="password">
        <input type="submit" value="Invia">
    </form>
</body>
</html>

Which is a simple page with no CSS and 2 forms to insert username and password.

The file send.php is the following:

<?php
    $username = filter_input(INPUT_POST, 'username');
    $password = filter_input(INPUT_POST, 'password');
    $conn = sqlsrv_connect('mylocalservername');
    $sql = "insert into dbo.data_input (column1, column2) values
('$username','$password')";
?>

I've just realised I missed the DB name string, but if I'm reading this error correctly, the problem is above since it seems unable to find the function.

I followed the instruction in order to install .dll drivers for PHP and SQL Server, accordingly to my version of PHP (php7ts.dll) they are:

php_pdo_sqlsrv_7_ts_x64.dll

php_sqlsrv_7_ts_x64.dll

Then I looked at the folder in the php.ini file where to put these .dll files:

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir="C:\xampp\php\ext"

So I put these files in the _extension_dir_ folder then I saved the .ini and restart all my system.

Unfortunately, the error still remains the same.

I will appreciate your kind help and sorry for my bad english,

0 Answers0