Skip to content

Instantly share code, notes, and snippets.

@dikiwidia
Created May 3, 2020 10:44
Show Gist options
  • Save dikiwidia/34d64b1167b1b4003aa939b2f5d9e0ab to your computer and use it in GitHub Desktop.
Save dikiwidia/34d64b1167b1b4003aa939b2f5d9e0ab to your computer and use it in GitHub Desktop.
<form action="<?php $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="text" name="user">
<input type="submit" value="Kirim">
</form>
<?php
// Variabel biasa
$nama = "Moch Diki Widianto";
$angka_pertama = 4;
$angka_kedua = 2;
// Variabel super global
// $output = $_GET['user'];
$output = $_POST['user'];
// operator PHP
// Ini komentar saya.
/*
Ini adalah
Komentar Saya
di PHP
*/
echo "Saya adalah ".$nama;
echo "<br />";
echo "Hasilnya adalah: ".$angka_pertama ** $angka_kedua;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment