Hi. Newbie here. I just installed the latest Chrono forms component and mambot on a Joomla 1.5 site. I set up a simple form w/no validation, to save data to a table. The form processes fine from the user point of view, but when I try to "Show Saved Data", there's nothing there. My form code and auto-generated code follow. Any suggestions appreciated!
Form code:
<p> </p><p>We're looking for input into the songs we sing in Sunday services. We want to know your five favorite Christian songs. It doesn't matter whether it's a traditional hymn or contemporary song, gregorian chant or church camp ditty. </p><p> </p><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="floatbox"><table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10%" valign="top"><strong>Song 1 </strong></td>
<td width="25%" valign="top"><input name="Song1" type="text" id="Song1" size="30"></td>
</tr>
<tr>
<td valign="top"><strong>Song 2 </strong></td>
<td valign="top"><input name="Song2" type="text" id="song2" size="30"></td>
</tr>
<tr>
<td valign="top"><strong>Song 3 </strong></td>
<td valign="top"><input name="Song3" type="text" id="Song3" size="30"></td>
</tr>
<tr>
<td valign="top"><strong>Song 4 </strong></td>
<td valign="top"><input name="Song4" type="text" id="Song4" size="30"></td>
</tr>
<tr>
<td valign="top"><strong>Song 5 </strong></td>
<td valign="top"><input name="Song5" type="text" id="Song5" size="30"></td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
The auto-generated code:
<?php
$database =& JFactory::getDBO();
srand((double)microtime()*10000);
$inum = "I" . substr(base64_encode(md5(rand())), 0, 16);
$database->setQuery( "INSERT INTO #__chronoforms_2 VALUES (
'' , '".$inum."','". date('Y-m-d')." - ".date("H:i:s")."', '".$_SERVER['REMOTE_ADDR']."' , '".JRequest::getVar('Song1','', 'post', 'string', '' )."' , '".JRequest::getVar('Song2','', 'post', 'string', '' )."' , '".JRequest::getVar('Song3','', 'post', 'string', '' )."' , '".JRequest::getVar('Song4','', 'post', 'string', '' )."' , '".JRequest::getVar('Song5','', 'post', 'string', '' )."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
Form code:
<p> </p><p>We're looking for input into the songs we sing in Sunday services. We want to know your five favorite Christian songs. It doesn't matter whether it's a traditional hymn or contemporary song, gregorian chant or church camp ditty. </p><p> </p><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="floatbox"><table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10%" valign="top"><strong>Song 1 </strong></td>
<td width="25%" valign="top"><input name="Song1" type="text" id="Song1" size="30"></td>
</tr>
<tr>
<td valign="top"><strong>Song 2 </strong></td>
<td valign="top"><input name="Song2" type="text" id="song2" size="30"></td>
</tr>
<tr>
<td valign="top"><strong>Song 3 </strong></td>
<td valign="top"><input name="Song3" type="text" id="Song3" size="30"></td>
</tr>
<tr>
<td valign="top"><strong>Song 4 </strong></td>
<td valign="top"><input name="Song4" type="text" id="Song4" size="30"></td>
</tr>
<tr>
<td valign="top"><strong>Song 5 </strong></td>
<td valign="top"><input name="Song5" type="text" id="Song5" size="30"></td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
The auto-generated code:
<?php
$database =& JFactory::getDBO();
srand((double)microtime()*10000);
$inum = "I" . substr(base64_encode(md5(rand())), 0, 16);
$database->setQuery( "INSERT INTO #__chronoforms_2 VALUES (
'' , '".$inum."','". date('Y-m-d')." - ".date("H:i:s")."', '".$_SERVER['REMOTE_ADDR']."' , '".JRequest::getVar('Song1','', 'post', 'string', '' )."' , '".JRequest::getVar('Song2','', 'post', 'string', '' )."' , '".JRequest::getVar('Song3','', 'post', 'string', '' )."' , '".JRequest::getVar('Song4','', 'post', 'string', '' )."' , '".JRequest::getVar('Song5','', 'post', 'string', '' )."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>