Can i pass the form data to another form

Post any questions you may have here

Can i pass the form data to another form

Postby guessnoww on Thu Jul 03, 2008 9:21 am

Hello every one i'm new with this!
here is what i need , i want one form to accept info from users then after been submitted it is redirect to another form can i pass some of the data from the previous data to this form ? if yes help please:(
guessnoww
Fresh Boarder
 
Posts: 2
Joined: Thu Jul 03, 2008 9:08 am

Re:Can i pass the form data to another form

Postby GreyHead on Thu Jul 03, 2008 2:55 pm

Hi guessnoww,

Yes, I'd probably do this by creating a single ChronoForms form that contained both html forms and a little php to show one or the other. Otherwise you have to find a way to pass the data over, the safest is probably to write it into a database table and re-read it from the second form but other methods: cookies, session data, temporary files or adding to url can all be made to work.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3461
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Can i pass the form data to another form

Postby guessnoww on Fri Jul 04, 2008 7:55 am

Thanks for your support BOB i am really new with this can i have the how to of your options (the tiny php code to control the forms and attaching variables to the url)
Thanks again
guessnoww
Fresh Boarder
 
Posts: 2
Joined: Thu Jul 03, 2008 9:08 am

Re:Can i pass the form data to another form

Postby GreyHead on Fri Jul 04, 2008 2:18 pm

Hi guessnoww,

Here's one way of putting two forms in one.
Code: Select all
<?php
if ( $_POST['last_form'] == "" ) {
?>
  // show basic form
  <input type="hidden" name="last_form" value="1" />
<?php
} elseif ($_POST['last_form'] == 1 {

  echo "Your name is $_POST['name']";
  . . .
}
?>
this is much simplifed to give you an idea. The code needs expanding and testing to work in practice.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3461
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Can i pass the form data to another form

Postby nbriones on Sun Jul 13, 2008 1:49 am

Hi.. how can you pass values using session?

What i have done, is to modify index.php, adding the next code:

/**
* DISPATCH THE APPLICATION
*
* NOTE :
*/
$option = JRequest::getCmd( 'option' );


// ********* Added code ***********
if ( $option=="com_chronocontact" )
{
session_start();
$_SESSION['post']=$_POST;
}
// ********* Added code ***********


Then, inside a form, i try to use $_SESSION['post'], but nothing happens. I know $_SESSION['post'] has the $_POST array inside index.php, but inside the form, the session seems to be cleaned up.

Any help would be nice...

Regards,

Nicolas
nbriones
Fresh Boarder
 
Posts: 2
Joined: Sun Jul 13, 2008 1:39 am

Re:Can i pass the form data to another form

Postby nbriones on Sun Jul 13, 2008 3:35 am

I tried also the first solution, but when it reload the same form, the $_POST array is empty.

I create the form, and i set the "Redirect URL:" to the same form (i copied and pasted the URL from the "Forms Management", under the Link column), but nothing happens...
nbriones
Fresh Boarder
 
Posts: 2
Joined: Sun Jul 13, 2008 1:39 am


Return to ChronoForms Questions & Answers

Who is online

Users browsing this forum: Google [Bot] and 2 guests