I am constructing a Mandarin tuition intranet site which will include interactive translation exercises. To maximise the spread of vocabulary for practising a particular sentence pattern, I have designed a system in which sentence components are picked randomly from a MySql table, but need to be able to rank the components so that only sensible combinations are assembled. A ‘hierarchy’ field in the table contains integers which form the basis of a test to distinguish valid and non-valid combinations. To this end I am experimenting with an intermediate page which onLoad POSTs a conditional string (extracted from a second table in the MySql database) to be used in a MySql retrieval process in the receiving page which should loop until a sensible sentence has been constructed. The string is of the following form:
[php](({$dd_test_val[0][1]}-{$dd_test_val[0][4]}==0) || ({$dd_test_val[0][1]}-{$dd_test_val[0][4]}==1)) & (({$dd_test_val[0][4]}-{$dd_test_val[0][2]}==0) || ({$dd_test_val[0][4]}-{$dd_test_val[0][2]}==1)) & ({$dd_test_val[0][1]}-{$dd_test_val[0][3]} < 4)[/php]
When it reaches the receiving page, the POSTed string is read into a variable $h_form, but simply creating the $dd_test_val array and testing if($h_form) doesn’t seem to work. Is there in fact any way of passing a conditional string in the way I am attempting, or is this potential solution doomed to failure?