Form results when using redirect URL...

User 187934 Photo


Senior Advisor
20,200 posts

Give a bit and I'll see if I can track the location down for you. I'm in the middle of a VBA project at work that needs most of my attention.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 345797 Photo


Registered User
48 posts

I am new with both php and html. Like the above posts I want to pass data from a form on one html page to another. Example: page 1 - registration information with students name - using WFB embedded in a page created with visual site designer. Submit button is a redirect custom page to
Page 2 - program choices, page is second page in visual site designer. WFB form is embedded in the page.

So far it works just fine (there is one wrinkle but that is beside the point at the moment).

what I want to do is take the name from Page 1 and put it into the name field in the WFB form embedded in Page 2.

I know that there is a php file, myformname.php which is referenced in the action= statement of the myformname.html.

So, if I want to pickup the field information from form1 on pag1 and transfer it to form2 on page2 what would I need to do?

Thanks so much.

Janice
User 187934 Photo


Senior Advisor
20,200 posts

Use the $_SESSION variables
http://www.coffeecup.com/forums/web-for … post239658
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 345797 Photo


Registered User
48 posts

Ok, I see from the code how I can get the session variables, I presume it goes into form2.html?
<?php session_start(); ?>
some html code
<body>
<?php
$post = $_SESSION['post']; // This is getting the post array
$name= $post['FirstName'];
?>
then I'm stumped because how do I get it into the field Name on form2?
I didn't think I could say

<input name="FirstNamePrg" id="item17_text_1" type="text" maxlength="254"
placeholder="" data-hint="" autocomplete="off" value = $name />
User 187934 Photo


Senior Advisor
20,200 posts

<?php if(isset($_SESSION['post'])){$name = $post['name'];} ?>
<input name="FirstNamePrg" id="item17_text_1" type="text" maxlength="254"
placeholder="" data-hint="" autocomplete="off" value = "<?php echo $name;?>" />
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 345797 Photo


Registered User
48 posts

Eric I appreciate your help.

I entered the information as above and got
<?php echo $name;?> displayed in the inputbox and not the name.

The following are the lines with approximate placement in the form2.html file
At the very top of the page
<?php session_start(); ?>
<!DOCTYPE HTML>
....
<body><!-- Start of the body content for CoffeeCup Web Form Builder -->
<?php
$post = $_SESSION['post']; // This is getting the post array
$name= $post['LastName'];
?>
<style>#docContainer .fb_cond_applied{ display:none; }</style>
....
<?php if(isset($_SESSION['post'])){$name = $post['LastName'];} ?>
<div class="fb-input-box">
<input name="FirstNamePrg" id="item17_text_1" type="text" maxlength="254"
placeholder="" data-hint="" autocomplete="off" value = "<?php echo $name;?>" />

enter data into Form1 on page1, press submit, get the confirm page which redirects to page2 with embedded form2. The information above is found in form2.html.

User 187934 Photo


Senior Advisor
20,200 posts

You need to alter your .htaccess file on your host. Add this line.
AddHandler application/x-httpd-php .php .html .htm
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,200 posts

Here's a proof of concept. When you submit form one you will end up at form two with the same options and values as chosen on form one. Refresh form two to unset the variables.
http://ericrohloff.com/coffeecup/ccforu … /form-one/
The only form altered is form two.
Also remove the script surrounding the embed iframe code for form two.

This is what you need to make multi page forms with the current formbuilder setup.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 345797 Photo


Registered User
48 posts

Hi Eric,
I created an .htaccess file under public_html. I had to use a slightly different entry AddHandler application/x-httpd-php53 .html .htm as per the wiki for lunarpages my hosting server. Unfortunately the php is still not being run and I'm getting the <?php echo $LastName ; ?> in the name field and not the name. I added the php to the top of form2.html, and the php for the inputbox.

<?php session_start();
$post = $_SESSION['post']; // This is getting the post array
$LastName = $post['LastName']; ?>
<!DOCTYPE HTML>
<html>
... some more html
<input name="FirstNamePrg" id="item17_text_1" type="text" maxlength="254"
placeholder="" data-hint="" autocomplete="off" value = "<?php echo $LastName ; ?>" />

I looked at the source of your form and I'm a little confused. When I press the submit button for Form1, I get form2 with the data in it but if I look at the source for form2, it doesn't have the php in it. If I press the submit button on form2, it has the confirm page and when I look at the source for the confirm page it shows the php, in fact the source from the confirm page looks like for the form2. Is the problem I'm not putting the php in the correct file.

Is there something I should be adding to the php.ini file? or more to the .htaccess file?
User 345797 Photo


Registered User
48 posts

Hi Eric,
I just tried a hello world in a vanilla html page and it doesn't work. So do you have any idea why the php won't run in the html, even though I have a .htaccess file?

This is a test

<?php echo "Hello World"; ?>

This is a test shows up and the php code shows up but not just the echo.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.