Form results when using redirect URL...

User 10077 Photo


Senior Advisor
1,095 posts

When configuring the message for the confirm options, if you use "Confirmation Message" or "Redirect to a custom HTML page," you can use the form data in the confirmation message.

If you "redirect to another URL," is the form data passed so that it can be used that page? If so, is it past via _POST?
ASK ME ANYTHING
I provide personalized help for Coffeecup Users including personal or group training for Site Designer, Web Form Builder and more via Zoom.
Email me at support@uscni.org or call 865-687-7698.

Did you know that Web Form Builder can be used for both simple and complicated forms and that it's not limited to the default fonts and buttons? Take a look at a form we developed for WindowTinting.com.
https://forms.windowtinting.com/forms/w … ppingcart/
User 187934 Photo


Senior Advisor
20,193 posts

If I remember correctly the variables are all held in $_SESSION and they get unset so are lost.
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,193 posts

You can alter the code to keep it from unsetting the variables before it gets to the redirect. This will allow you to utilize the variables.
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 10077 Photo


Senior Advisor
1,095 posts

Cool. Thanks.
ASK ME ANYTHING
I provide personalized help for Coffeecup Users including personal or group training for Site Designer, Web Form Builder and more via Zoom.
Email me at support@uscni.org or call 865-687-7698.

Did you know that Web Form Builder can be used for both simple and complicated forms and that it's not limited to the default fonts and buttons? Take a look at a form we developed for WindowTinting.com.
https://forms.windowtinting.com/forms/w … ppingcart/
User 187934 Photo


Senior Advisor
20,193 posts

I thought it unset the variables on the redirect but it doesn't. I messed with this a while back and remember having to alter the code but here's an example where I'm redirecting and catching the values chosen. I did nothing to the form builders exported files.:cool:

http://ericrohloff.com/coffeecup/ccforu … index.html
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,193 posts

Here's the code I used to make the page above.
<?php session_start(); ?>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<?php
$post = $_SESSION['post']; // This is getting the post array
$number = $post['number']; // This is getting my number input name from the array called "number"
$dropdown = $post['dropdown']; // This is getting my dropdown name from the array called "dropdown"
// Add more as needed for each input on your form. Adjust to your input name.

if(isset($_SESSION['post'])) {echo'You made it to my page.<br><br> Here is what you chose on my form.<br><br>
The number you entered was '.$number.'<br><br>
The option you chose was '.$dropdown.'<br><br>
Refresh your browser to see the Session unset.<br><br>
Here\'s the session array. The one that holds the form variables is named post.';
echo '<pre>' . print_r($_SESSION, TRUE) . '</pre>';
}
else{echo 'You need to make choices <a href="dont-unset-variables/index.html">on my form</a>.';
}
unset($_SESSION['post']); // This unsets the $_SESSION['post'] array
// Here's how to unset one variable.
//$key=array_search($post['number'],$_SESSION['post']);
// if($key!==false) unset($_SESSION['post'][$key]);
?>
</body>
</html>
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 2716615 Photo


Registered User
23 posts

That is great Eric! Thanks. (btw - I think you've missed off session_start(); at the top of your listed code)

Much more elegant than my efforts with the CSV data...

...though if anyone is looking for a way to open up the CSV file and use it as a simple database perhaps they will find the thread here useful... http://www.coffeecup.com/forums/web-for … _id=239613

Rob.
User 2610782 Photo


Registered User
5 posts

Eric, I've been trying to do something similar to your code above without any luck. The difference in my scenario is the Redirect URL (for the confirmation) is coming back from a PayPal transaction. Now, the standard CC confirmation works as does the custom HTML confirmation, but of course, I can't grab the session vars using those techniques. Should I be doing something different? I just took your code and substituted what I wanted to see in the confirmation (see below). All I am getting is "You need to make choices..." which leads me to believe that the session vars have been unset.

<?php session_start(); ?>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<?php
$post = $_SESSION['post']; // This is getting the post array
$pp1_first = $post['pp1_first']; // This is getting my number input name from the array called "number"
$pp1_last = $post['pp1_last']; // This is getting my dropdown name from the array called "dropdown"
// Add more as needed for each input on your form. Adjust to your input name.

if(isset($_SESSION['post'])) {echo'You made it to my page.<br><br> Here is what you chose on my form.<br><br>
The First Name you entered was '.$pp1_first.'<br><br>
The Last Name you entered was '.$pp1_last.'<br><br>
Refresh your browser to see the Session unset.<br><br>
Here\'s the session array. The one that holds the form variables is named post.';
echo '<pre>' . print_r($_SESSION, TRUE) . '</pre>';
}
else{echo 'You need to make choices <a href="dont-unset-variables/index.html">on my form</a>.';
}
unset($_SESSION['post']); // This unsets the $_SESSION['post'] array
// Here's how to unset one variable.
//$key=array_search($post['number'],$_SESSION['post']);
// if($key!==false) unset($_SESSION['post'][$key]);
?>
</body>
</html>
</html>
User 187934 Photo


Senior Advisor
20,193 posts

I bet that when you go to the confirmation page with the paypal button the variables are unset. You would need to alter the code to stop that from happening.
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 2610782 Photo


Registered User
5 posts

Eric,

When you say the "confirmation page withe the paypal button," are you referring to the page the user receives immediately after submitting the form. That is, the page that says "Almost Done!"? If so, where would I find that page in the files exported and uploaded to my web server?

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.