<?php
/*
Some random connection */
$con = mysql_pconnect (host, user, pass) or trigger_error (mysql_error(), E_USER_ERROR);
mysql_select_db (db, $con) or trigger_error (mysql_error(), E_USER_ERROR);
/*
Some random if else statement */
if ($donkey !== $kingKong) {
echo 'We have a serious problem here';
} else {
echo 'WTF?!?! A Donkey and King Kong are you mad?!?';
}
/*
Some random switch */
$_GET['cases'] = isset($_GET['cases']);
switch($_GET['cases']) {
case 'one' : echo 'one'; break;
case 'two' : echo 'two'; break;
case 'andsoon' : echo 'I\'m sure you get the picture now';
default : echo 'cases'; break;
}
/*
Form */
if (!isset($_POST['email'])) { ?>
<form action="file.php" method="post">
<span>Email:</span><input type="text" name="email" />
<input type="submit" value="submit" />
</form><?php
} else {
if (!filter_var ($_POST['email'], FILTER_VALIDATE_EMAIL) ) {
echo 'Oh nuts I wanted a real one to feed my Google Bots -.-';
} else {
echo 'There you go little bottys!';
}
echo 'Your Email: '.$_POST['email'];
}
/*
Just testing the PHP tags on MakeWebGames...... */
?>
That's from NotePad ++