Forums

Passing Form Data

mrgee 09 Jan, 2009
How can I pass form data?
Here is a simple form that pass on text field to a php file called test.php
When I click the submit button the data is passed but not within my joomla page..
Instead the data is passed to a new page.. How can I pass the data within the Joomla environment?
Thanks
<table width="80%" align="center">
<tr>
<td  >
</td>
</tr>
<tr>
<td >
</td>
</tr>
<tr>
<td align ="center">Postcode   
<input name="postcode" type="text" />
</td>
</tr>
<tr>
<td align ="center">
<input name="send" type="submit" value="NEXT"/>
</td>
</tr>
</table>
GreyHead 09 Jan, 2009
Hi mrgee,

I'm sorry, I don't understand your question. Where do you want the data passed to adn what do you want to do with it?

Bob
mrgee 09 Jan, 2009
I would like the data passed back to a content page within the joomla framework..
At the moment the data gets passed to a blank page..
GreyHead 09 Jan, 2009
Hi mrgee,

It's only a blank page because you haven't specified any output. If you write
<?php
$postcode = JRequest::getString('postcode, '', 'post');
echo "<p>The post code is $psotcode</p>";
?>
in the OnSubmit after box then you will see the result.

Bob
mrgee 09 Jan, 2009
Hi..
You misunderstand me..I am very familiar with PHP..Just new to Joomla.. The php script that receives the data passed from the chrono form contains the data I want.. When I say a blank page what I mean is that it is not part of my Joomla website.. it has no header or menus etc..just a white page with the data.. What I want is the data to appear within my Joomla website..
GreyHead 09 Jan, 2009
Hi mrgee,

Sorry, it's impossible to know who knows what here. A completely blank page in Joomla is usually the result of a PHP parsing error somewhere but the code snippet you posted looks good to me.

You could try turning Error Reporting for you site up to Maximum and see if an error report is produced.

Bob

PS The standard ChronoForms output is a blank content area inside the Joomla template layout or menus and modules.
mrgee 09 Jan, 2009
Thanks for your help here..
After reading some more and experimenting I am progressing.. with your help.. I have now placed my data processing code in the on submit window, as you suggested, and am not passing it to a seperate php script this works in as much as my form data is returned within the overall Joomla page..
However now I continuallu receive error.. its a rted x with the following text
Sorry but you can not submit the form again very soon like this!
Now matter how long I wait.. 5 mins.. the error is still there when I load the chrono form..
Any ideas?
Thanks again for your help
Max_admin 09 Jan, 2009
Hi mrgree,

did you add any value in the "limit form submissions" field in the general tab?

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
mrgee 09 Jan, 2009
No I have not specified any time period.. This field is blank
GreyHead 10 Jan, 2009
Hi mrgee,

I've never seen this problem before. I think that you can get round it by commenting out this code block in chronocontact.php - around line 148-164
	// Check how soon was the last submission
	if(trim($paramsvalues->submissions_limit)){
		if(!$session->get('chrono__submissions_limit', 'default', md5('chrono'))){
			$session->set("chrono__submissions_limit", mktime(date("H"), date("i"), date("s"), date("m")  , date("d")+1, date("Y")), md5('chrono'));
		}else{
			if(($session->get('chrono__submissions_limit', 'default', md5('chrono')) + ((int)trim($paramsvalues->submissions_limit))) > mktime(date("H"), date("i"), date("s"), date("m")  , date("d")+1, date("Y"))){
				$session->set("chrono_verification_msg", 'Sorry but you can not submit the form again very soon like this!', md5('chrono'));
				showform($posted);
				return;
			}else{
				$session->set("chrono__submissions_limit", mktime(date("H"), date("i"), date("s"), date("m")  , date("d")+1, date("Y")), md5('chrono'));
			}
		}
	}
	if ( $debug ) {
		$mainframe->enqueueMessage('Form passed the submissions limit (if enabled) OK');
	}

Bob
This topic is locked and no more replies can be posted.