Tag: PHP
PHP 8.3 Debian 12 Instalacja
Debian 12 + Apache 2 + Obsługa PHP 3
Zakładając, iż masz już poprawnie zainstalowany system Debian 12 w wersji 12, oraz serwer stron www...
PHP MySQL Connect to Database PDO
Below is a sample PHP code, that after configuration, can be used to connect to your database.
<?php
$DBType = "mysql";
$DBHost = "database-host";
$DBPort = "3306";
$DBEnco =...
Detect Browser Language in PHP
You can detect browser language using PHP global variable $_SERVER, exactly $_SERVER
EXAMPLES:
1.
<?php
$BLang= Locale::acceptFromHttp($_SERVER);
echo $BLang; // Return: en
?>
2.
<?php
$BLang= locale_accept_from_http($_SERVER);
echo $BLang; // Return: en
?>
3. Using substr...
Visitor IP Address
This bellow PHP code help you get a real IP address visitors of your website.
<?php
function GetUserIP() {
if(isset($_SERVER)) {
$_SERVER = $_SERVER;
$_SERVER = $_SERVER;
}
$client = @$_SERVER;
$forward...
PHPMailer Disable SMTP SSL Certificate Verification in PHP
How to disable checking of the mail serves certificate in PHPMailer code SMTP Options
$mail->SMTPOptions =
];
If you have any questions,
write your question bellow in...
Laravel CarbonCarbon::setLastErrors()
If you have a problem with Laravel Carbon and you see error like that:
Laravel CarbonCarbon::setLastErrors()
or
CarbonCarbon::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool...
MySQL Connect Query Select Search Insert Update Delete
MySQL Connect
<?php
$mysqli = new mysqli("host", "username", "password", "dbname", "port", "socket");
if($mysqli -> connect_errno) {
echo "MySQL Connection Error: " . $mysqli -> connect_error;
exit();
}
?>
MySQL Query:
If you have...
phpMyAdmin Deprecation Notice in PHP 8
ERROR (example):
Deprecation Notice in ./../../php/Twig/Loader/FilesystemLoader.php
realpath(): Passing null to parameter #1 ($path) of type string is deprecated
Backtrace
FilesystemLoader.php: realpath(NULL)
./libraries/classes/Template.php: TwigLoaderFilesystemLoader->__construct(string '/usr/share/phpmyadmin//templates/')
./libraries/classes/Theme.php: PhpMyAdminTemplate->__construct()
./libraries/classes/Theme.php: PhpMyAdminTheme->__construct()
./libraries/classes/ThemeManager.php: PhpMyAdminTheme::load(
string './themes/pmahomme',
string '/usr/share/phpmyadmin/./themes/pmahomme/',
)
./libraries/classes/ThemeManager.php:...