Hey all I am pretty much new to php and I am trying to use an if statement thing to assign a variable. Using the if statement I want to grab data from another variable which is getting its data from a html select form. Basically I want to pull two different things from the select form that are related to the one thing if you get that lol. So my code is like this (simplified):
CODE
<select name="program">
<option value="100-100">Result1</option>
<option value="100-200">Result2</option>
<?php
$program = $_POST['program'];
if ($program==100-100) $result = headache;
if ($program==100-200) $result = biggerheadache;
?>
I am getting an error: Parse error: syntax error, unexpected T_IF
I am not to sure if I am writing the if statement correctly or if this is actually the easiest way to go about doing what I want to do, any help much appreciated
This post has been edited by Mike88: 12 Oct, 2008 - 02:27 AM