<?php
$location = ($_GET["l"]);
if ($location == "ta") {
echo "triad";
} elseif ($location == "ti") {
echo "triangle";
} else {
echo "Default";
}
?>
// Same thing writtend with encapsulated HTML
<?php $location = ($_GET["l"]);?>
<?php if ($location == "val1"): ?>
Option One
<?php elseif ($location == "val2"): ?>
Option Two
<?php elseif ($location == "val3"): ?>
Option Three
<?php else: ?>
Otherwise this will show.
<?php endif; ?>
Simple php if else using urldecode string.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.