Peter Mackenzie's Random Parallelogram And Circle Picture Generator
CODE FOLLOWS
<?php
include('includes/header.php');
$step = isset($_POST['step']) ? $_POST['step'] : 0;
$size = isset($_POST['size']) ? $_POST['size'] : ".5";
$objectsize = isset($_POST['objectsize']) ? $_POST['objectsize'] : ".25";
$circleprob = isset($_POST['circleprob']) ? $_POST['circleprob'] : "50";
$size = floatval($size);
$objectsize = floatval($objectsize);
$circleprob = intval($circleprob);
$self = basename($_SERVER['SCRIPT_NAME']);
?>
<h1>Peter Mackenzie's Random Parallelogram And Circle Picture Generator</h1>
<form action="<?php echo($self); ?>" method="POST">
<table style="width:50%">
<tr>
<td class="right">
Picture Size:
</td>
<td class="left">
<select name="size">
<option value = ".25"<?php if ($size == .25) echo('selected="selected"'); ?>>Small</option>
<option value = ".5"<?php if ($size == .5) echo('selected="selected"'); ?>>Medium</option>
<option value = "1"<?php if ($size == 1.0) echo('selected="selected"'); ?>>Large</option>
</select>
</td>
</tr>
<tr>
<td class="right">
Object Size:
</td>
<td class="left">
<select name="objectsize">
<option value = ".10"<?php if ($objectsize == .1) echo('selected="selected"'); ?>>Small</option>
<option value = ".25"<?php if ($objectsize == .25) echo('selected="selected"'); ?>>Medium</option>
<option value = ".5"<?php if ($objectsize == .5) echo('selected="selected"'); ?>>Large</option>
</select>
</td>
</tr>
<tr>
<td class="right">
Circle Probability:
</td>
<td class="left">
<select name="circleprob">
<?php
For ($x=0;$x<101;$x++)
{
$selected = '';
if ($circleprob == $x)
{
$selected = "selected=\"selected\"";
}
echo ("<option value = \"$x\" $selected>$x%</option>");
}
?>
</select>
</td>
</tr>
<tr>
<td>
<input type="submit" name="submit" value="Submit">
</td>
</tr>
</table>
<?php
$gettext = "graphics.php?picwidth=" . 800 * $size . "&picheight=" . 800 * $size . "&circleprob=$circleprob&objectsize=$objectsize";
echo("<img src=\"$gettext\"<br>");
?>
<?php
echo("<hr>");
highlight_file("graphics.php");
include('includes/footer.php');
?>