I've been learning how to script PHP with SQL, and am asking around on Gaia about Linux and it's different distributions.
And I'm proud of myself.
surprised I created my own PHP page by using what I learned so far.~ [
Link ]
Doesn't look like much, but it's actually this:
if (isset($_POST['submit_text'])) {
if (empty($_POST['text1']) || empty($_POST['text2'])) {
echo "Please fill both text fields before clicking Submit.";
} elseif (isset($_POST['text1']) && isset($_POST['text2'])) {
$text1 = $_POST['text1']
$text2 = $_POST['text2']
echo "You said $text1 and $text2!";
}
} elseif (isset($_POST['submit_num'])) {
if (empty($_POST['num1']) || empty($_POST['num2'])) {
echo "Please fill both number fields before clicking Submit.";
} elseif (!is_numeric($_POST['num1']) || !is_numeric($_POST['num2'])) {
echo "Please make sure both number fields contain numbers only.";
} elseif (is_numeric($_POST['num1']) && is_numeric($_POST['num2'])) {
$num1 = $_POST['num1']
$num2 = $_POST['num2']
$total = $num1 + $num2;
echo "Adding $num1 to $num2 gives a result of $total.";
}
}
?>
And that doesn't include any of the HTML part. o.o