HI. Firstly, i couldnt get the link to the form to work. Then i disabled the SEF URL's extension and it worked.
Is this a known issue? If so is there any updates which will allow it to work with SEF URL's?
Secondly, I want to create a form which returns results from a database as opposed to storing the data.
So i put the following html in the html box.
Then i inserted the following php code into the autoGenerated code box.
Then insert the following code in to the On Submit code - after sending email box
However, this does not seem to work!
Then i tried submiting the form using the form URLs box. I type in the following URL.
templates/prime_languages/process_search.php - which is where the php file is located.
That did not work either.
I noticed in the autoGenerated code for one of my other forms there was the code... $database =& JFactory::getDBO();
So tried adding this to the top of my php code but still no joy.
In fact i have tried all different combinatations.
Can someone please please shed some light on the subject as i have been stuggling with this for many days now!!!
Thanks.
Is this a known issue? If so is there any updates which will allow it to work with SEF URL's?
Secondly, I want to create a form which returns results from a database as opposed to storing the data.
So i put the following html in the html box.
<p> Please select the languages in order to find an appropriate translator (NOTE: Use the shift button to select multiple languages):</p> <table border="0" cellspacing="0" cellpadding="2"> <tr><td>Languages Spoken</td> <td><select name="languages_spoken[]" multiple size="5"> <option value="English">English</option> <option value="French">French</option> <option value="Spanish">Spanish</option> <option value="German">German</option> </select></td> </tr> <tr> <td><input type="submit" name="Submit" value="Submit"></td> </tr> </table>
Then i inserted the following php code into the autoGenerated code box.
<?php $languages_spoken = $_POST['languages_spoken']; $lang_imploded = implode(",", $languages_spoken); $query = "SELECT * FROM #__chronoforms_1 WHERE lang_spoken LIKE '$lang_imploded%'"; $result = mysql_query($query) or die ('Error, insert query failed'.mysql_error());
Then insert the following code in to the On Submit code - after sending email box
// Print out the contents of the entry $num_rows = mysql_num_rows($result); print "There are $num_rows records.<P>"; print "<table width=200 border=1>\n"; while ($get_info = mysql_fetch_row($result)){ print "<tr>\n"; foreach ($get_info as $field) print "\t<td><font face=arial size=1/>$field</font></td>\n"; print "</tr>\n"; } print "</table>\n"; ?>
However, this does not seem to work!
Then i tried submiting the form using the form URLs box. I type in the following URL.
templates/prime_languages/process_search.php - which is where the php file is located.
That did not work either.
I noticed in the autoGenerated code for one of my other forms there was the code... $database =& JFactory::getDBO();
So tried adding this to the top of my php code but still no joy.
In fact i have tried all different combinatations.
Can someone please please shed some light on the subject as i have been stuggling with this for many days now!!!
Thanks.