I decided to use another form of form validation. however i can't figure out whats the problem. it always give me a parse error in line 27.
============================================================================
<html>
<head><title>A PROGRAM TO GENERATE SPIRALS GALAXY</title></head>
<body>
<!--form validation-->
<?php
$arms = $POST ['arms'];
$kind = $POST ['kind'];
$amplitude = $POST ['amplitude'];
$width = $POST ['width'];
$radpitch = $POST ['radpitch'];
$pitchangle = $POST ['pitchangle'];
$backshape = $POST ['backshape'];
$backrad = $POST ['backrad'];
$edgeshape = $POST ['edgeshape'];
$armsrad = $POST ['armsrad'];
$tried = ($_POST['tried'] == 'yes');
if($tried){
$validated = (!empty($arms) && !empty($kind) && !empty($amplitude) && !empty($width) && !empty($radpitch) && !empty($pitchangle) && !empty($backshape) && !empty($backrad) && !empty($edgeshape) && !empty($armsrad))
<p>Please fill out all the fields to continue.</p>
<?php
}
}
if($tried && $validated){
echo The item has been created.
}
?>
<form action="test1.php" method="POST">
<!-- help button -->
<input type="button" value="Help" onClick="parent.location='helpform.php'"> <br /><br />
<!--user input-->
Enter the values<br /><br />
No of arms: <input type"text" name="arms"/>
<input type="button" value="?" onClick="parent.location='helpArms.php'"> <br /> <br />
The type of galaxy 1=log, 2=linear, 3=hyp: <input type"text" name "kind"/>
<input type="button" value="?" onClick="parent.location='helpKind.php'"> <br /> <br/>
Amplitude of the arms from the galaxy: <input type"text" name "amplitude"/>
<input type="button" value="?" onClick="parent.location='helpAmplitude.php'"> <br/> <br/>
The width of the arms: <input type"text" name "width"/>
<input type="button" value="?" onClick="parent.location='helpWidth.php'"> <br/> <br/>
The radius at which angle the galaxy has the pitchangle of i0: <input type"text" name "radpitch"/>
<input type="button" value="?" onClick="parent.location='helpRadpitch.php'"> <br /> <br/>
The pitchangle at radius radpitch: <input type"text" name "pitchagle"/>
<input type="button" value="?" onClick="parent.location='helpPitchangle.php'"> <br/> <br/>
The value of the (double)backshape: <input type"text" name "backshape"/>
<input type="button" value="?" onClick="parent.location='helpBackshape.php'"> <br/> <br/>
The radius of the centre from the galaxy: <input type"text" name "backrad"/>
<input type="button" value="?" onClick="parent.location='helpBackrad.php'"> <br/><br/>
The value of the edgeshape: <input type"text" name "edgeshape"/>
<input type="button" value="?" onClick="parent.location='helpEdgeshape.php'"> <br/> <br/>
The radius of the arms from the galaxy: <input type"text" name "armsrad"/>
<input type="button" value="?" onClick="parent.location='helpArmsrad.php'"> <br/><br/>
<!--submit button-->
<input type="submit" value="<?php echo $tried? 'Continue' : 'Submit'; ?>"/><br />
</form>
</body>
</html>
One more thing why is "?>" after the "{" ? can i just place it before "if(!$validated)".
if(!$validated){
?>