Skip to content

Instantly share code, notes, and snippets.

@agungsp2000
Last active April 26, 2020 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agungsp2000/21b187de1570ce1046476534ebdb8c89 to your computer and use it in GitHub Desktop.
Save agungsp2000/21b187de1570ce1046476534ebdb8c89 to your computer and use it in GitHub Desktop.
index.php pelajarandigital ke-2
<?php
$fromid = urldecode($_REQUEST['nomor']);
$txt = urldecode($_REQUEST['msg']);
$tcap=strtoupper($txt);
$tz_object = new DateTimeZone('Asia/Jakarta');
$datetime = new DateTime();
$datetime->setTimezone($tz_object);
$timestamp=$datetime->format('Y\-m\-d\ H:i:s');
require_once __DIR__ . '/db_config.php';
$con = mysqli_connect(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
// mysqli_query($con,”insert into log values(‘$fromid’)”);
if( !(strpos($tcap, "HALO")===false))
{
echo "Apa kabar sekarang tanggal $timestamp";
}
else if( !(strpos($tcap, "ALL")===false))
{
echo "
1. satu
2. dua
3. tiga
";
}
else echo "
Silakan pilih menu yang disediakan
1. @HELP
2. @TIME
3. PRODUK
";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment