Variables

admin

Administrator
Staff member
I got a problem with php and html-inputs. I have an input box (radio type), with questions to them. The questions do I fetch from my database with mysql --> Then I generate names to these tags as ans1, ans2, ans3,...and so on until the final question. My problem is then: what shall I do when I ask "are this variabel valued 1 or 2"? To get this general, I tried:
if ($ans.$id == 1) ... $id has the value 1,2,3...as many question I have. I want this variabel to check if I have marked 'yes' or 'no'. What shall I do?
 
Back
Top