How do I write an If/then statement in PHP for the following:
I want one variable to equal a numeric value IF another variable has a particular string for a value.
Basically, I want to convert qualitative data selected using radio buttons to be converted into quantitative data. However, I need the immediate values identified in the radio button command to be the qualitative strings. Therefore, I figured I would create two variables for each section, which would allow for the conversion if I can get the code right. I then want to add up all the values of the second variables to produce an overall score.
Something along the lines of:
If $value1="My name is Tom" Then $value2="2"
Also,the form script and handling script are separate files. In light of this, is it better to write the If/Then statement in the form code or handle code.
Any help would be appreciated.
Thanks.
