Jump to content

TStyles

New Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by TStyles

  1. i want to make sure i have the correct sql drivers installed. can you check it for me please(links are safe ,images uploaded to imgur) here's the files i downloaded from Microsoft's website: http://imgur.com/a/7O84l And here i moved the non thread safe x64 dlls to php ext directory: http://imgur.com/a/8Hz71 Finally i added them to the extensions in php.ini : http://imgur.com/a/TIGoB anything more i need to do? because i still don't have anything related to sqlserv when i go to phpinfo() page on the server!
  2. Just checked for error logs and there are none in the inetpub directories. How can i see if the sqlsrv_* functions are working correctly? I'll uninstall then reinstall the sql drivers for php,and see if it works.
  3. I kinda have to use MS SQL, i'm not getting any error when i attempr to login,it's just that only the first echo is working ... i already have the sql drivers for php installed and configured. I'm using IIS too.
  4. I am new to PHP and this is the first try to code. I have a login Form with Email and password,when the user submits the form ,there should be a connection to a MS SQL Server and then Check to see if the values are valid. check1 is being displayed but everything after is not. Is this the correct way to connect to MS sql server?Most articles on the internet are using MYSQL so i can't find much info on SQL Server. PHP code is present on the same page as the html. I am desperate to know why the code isn't working,Thanks for the help. Here is what i have tried so Far: HTML code: <form class="form-horizontal" method="post" action="Login.php"> <input type="email" id="inputEmail" class="form-control" name="username" placeholder="Email address" required > <input type="password" id="inputPassword" class="form-control" name="password" placeholder="Password" required > <button class="btn btn-lg btn-primary btn-block" type="submit" name='Submit' value='Submit'>Login</button> </form> PHP Code: if (isset($_POST['Submit'])) { Login(); } function Login() { $username = trim($_POST['username']); $password = trim($_POST['password']); $serverName = "TAREX-09\MSSQLSERVER"; //name of server(locally) $connectionOptions = array("Database" => "Insurance"); echo 'check1'; //Connect using Windows Authentication. $conn = sqlsrv_connect($serverName, $connectionOptions); echo 'check2'; if (!$conn) { echo 'failed'; //die(FormatErrors(sqlsrv_errors())); } $tsql = "SELECT EmailAddress,Password FROM Customer_Detail WHERE EmailAddress=$username AND Password=$password "; $getlogin = sqlsrv_query($conn, $tsql); if ($getlogin === false) { echo 'Login Failed'; } else { echo 'Login Success'; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.