Forums

Form doesn't write data in table / debug

OCS 05 Mar, 2008
Hi, i've been searching the forum and red the FAQ but I haven't found specific help for my situation.

I have Joomla 1.5.1 installed and I'm running it on localhost. Legacy mode is enabled and I'm not using any third party SEF -extensions.

I've created a form through Menus -> Menu item -> Chrono Contact and made all the adjustements so that I can now see the form. I've got the same form also in different page added with Mambot just for testing purposes.

I created a simple form (taken from this site):

Name: <input name="name" value="" type="text"><br />
E-mail: <input name="email" value="" type="text"><br />
<input name="submit" value="Submit" type="submit">


I'm not emailing it. No validation and verification enabled. Just default settings.

Now I create the table for the form and it works (writes the table in database). The autogenerated code is:

<?php 
	$database =& JFactory::getDBO();
	
$database->setQuery( "INSERT INTO #__chronoforms_2 VALUES  (
'' , '". date('Y-m-d')." - ".date("H:i:«»s"«»)."', '".$_SERVER['REMOTE_ADDR']."' , '".JRequest::getVar('name','' 'post', 'int', 0 )."' , '".JRequest::getVar('email','' 'post', 'int', 0 )."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>


If I try to submit the form, it doesn't write anything to the database. I tried to switch debug on but it doesn't output anything. Does't it use some kind of log or should it output something in the page?
GreyHead 05 Mar, 2008
Hi OCS,

DeBug should show you the $_POST array when email is off (though it might need amending for Joomla 1.5) it doesn't show anything else.

Try turning email back on - you can use a dummy send address like [email]user@example.com[/email] - and see what you get in debug then.

Bob
OCS 06 Mar, 2008

Hi OCS,

Try turning email back on - you can use a dummy send address like [email]user@example.com[/email] - and see what you get in debug then.


Doesn't do anything and no debug information. It just throws me back to front page.
GreyHead 06 Mar, 2008
Hi OCS,

Max has released a bugfix version of ChronoForms for Joomla 1.5

Please download it, ftp the files over the existing install or backup your forms and reinstall.

Bob
OCS 06 Mar, 2008

Hi OCS,

Please download it, ftp the files over the existing install or backup your forms and reinstall.


Yes! It worked! Thank you🙂
degeert 06 Mar, 2008
I posted a bug concerning this. I think there's a missing "," in JRequest::getVar
'name','''post', should be 'name','','post'
and 'int' should be 'string' I think? For me it works now (table in db get populated)
This topic is locked and no more replies can be posted.