Forum Moderators: coopster
However, I am using this on a page that could be accessed without any variables defined in the URL, so how can I 1.) Modify the code below to indicate a default or 2.) Have no text display at all? I've tried adding a clause "or die("File not found!")" (no quotes in the code, just added here for readability), but it doesn't really work. Thanks!
<?php
$domain = $_GET['domain'];
echo "the domain is: $domain";
?>
PS: There is a parallel thread to this one located at [webmasterworld.com...]
It had a colon at the end; not a semi-colon(; )
<?php
$domain = $_GET['domain'];
if ($domain)
{
echo "this is the text that would appear";
}
else
{
echo ' ';
}
?>
PS: Thank you both for you help; the code works perfectly as originally requested.
<?php
$domain = $_GET['domain'];
if ($domain == "y")
{
echo "this is the text that would appear";
}
?>
switch($_GET['domain']){
case 'xyz':
echo 'this domain is xyz';
break;
case 'abc':
echo 'this domain is abc';
break;
default:
echo 'this domain is default';
break;
}