How can the distinction between server-side and client-side scripting languages impact the functionality of a website?

The distinction between server-side and client-side scripting languages can impact the functionality of a website by determining where the code is executed. Server-side scripts run on the web server before the page is sent to the user's browser, while client-side scripts run on the user's browser after the page has been received. This can affect things like site performance, security, and user experience.

<?php
// Server-side PHP code
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>