database connection file
db_con.php
<?php
// Enable error reporting
//error_reporting(E_ALL); // Report all errors
error_reporting(E_ERROR | E_PARSE); // Show only errors and parse errors
ini_set('display_errors', 1); // Display errors on the web page
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
// Database connection parameters
$host = "172.18.0.3";
$user = "root";
$password = "7133";
$database = "fm";
$mysqli = new mysqli("$host", "$user", "$password", "$database");
// Check for connection errors
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
?>
#!/usr/bin/php -q
<?php
require(__DIR__."/getInfo.php");
$PhoneNum="$argv[1]";
$query_val_phone = "SELECT count(phoneNumber) as phoneNumber_num FROM users where phoneNumber='$PhoneNum'";
$registered=select($query_val_phone)[0]['phoneNumber_num'];
if($registered>0){
echo "EXEC Verbose \"User PhoneNum already registered\"\n";
echo "EXEC Goto \"music,100,1\"";
}
else {
echo "EXEC Verbose \"Phone number $PhoneNum is not registered\"\n";
echo "EXEC Goto \"singup-en,sign-1,1\"";
}
?>