Different email response based on...

User 2942998 Photo


Registered User
74 posts

Eric Rohloff wrote:
Yes, you can do what ever you want to do with this as far as styling and linking to content and how that appears to the user. PDF, ZIP, CSV, html, etc.
Yes you can use a dropdown for this also. If you share your form I can tweak the code to fit what you already have and post it for you to try.

Hey Eric, very generous offer and I appreciate the guidance. Since the concept is validated, I will have to build the form. I will most likely try to figure out how to do this, I'm sure it will take me at least 500 more lines and hours longer than it should, but that's how we learn.

l'll keep you in loop if that's OK. Thanks again for everything and for ALL of your contributions to the forums.
User 187934 Photo


Senior Advisor
20,239 posts

Get your form going and I'll share an example of the code you'll need.;)
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 2942998 Photo


Registered User
74 posts

Thank Eric, I appreciate the assist.
User 2942998 Photo


Registered User
74 posts

Hey Eric,
It's been awhile, hope all is well with you.
We were discussing different responses based on a form selection. I have a form built and would like to (based on selection) allow the visitor to fill out the form, select the course and the outline would then download.

This is the base form: http://vantekconsulting.net/presentation_request.html

In the dropdown box they would select the course they are interested in such as "Fiber Characteristics" and upon submitting the form it would download / open the course outline pdf.

Any help pointing me in the right direction would be appreciated. This would be similar to your sample but rather than radio buttons it would be dropdown.

Thanks in advance.
User 187934 Photo


Senior Advisor
20,239 posts

Give your drop down a better name so it's easier to understand how the code is working. It's currently named select11 Name it like presentations. That's what I will use in the example code.
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,239 posts

Here's a quick example of what you need. You'll need to save this code to a page and enter that location in your redirect setting in the form builder. You'll need to adjust the links to your domain and actual pdf locations. Don't worry about styling. Get the code working correctly first. This may need to be a .php page depending on server settings.
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title></title>
</head>
<body>
<?php
if(isset($_SESSION['post'])){
$post = $_SESSION['post']; // All Data
$presentation_choice = $post['presentations']; // Which value was selected in dropdown
if($presentation_choice == 'Fiber Characteristics'){ echo '<a href="https://mydomain.com/presentations/Fiber-Characteristics.pdf" target="_blank">Fiber Characteristics</a>';}
else if($presentation_choice == 'OTDR use and testing'){ echo '<a href="https://mydomain.com/presentations/OTDR-use-and-testing.pdf" target="_blank">OTDR use and testing</a>';}
else if($presentation_choice == 'Both Presentations'){ echo '<a href="https://mydomain.com/presentations/Fiber-Characteristics.pdf" target="_blank">Fiber Characteristics</a>
<br><br><a href="https://mydomain.com/presentations/OTDR-use-and-testing.pdf" target="_blank">OTDR use and testing</a>';}
;} else{ echo '<h1>Nothing to see!</h1>
<br><a href="https://mydomain.com/presentations/" target="_blank">Back to Presentations Form</a>';}
unset($_SESSION['post']);
?>
</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 2942998 Photo


Registered User
74 posts

Thank you! I will give this a shot and see if I can get it working. Thank you for the assist.
User 2942998 Photo


Registered User
74 posts

Hey Eric,

Thanks again for the assist. I have renamed everything to align better with the intent of course outlines. I understand the code and have everything working (at least until I break it) so on to the formatting.
I did a page in RSD and added an HTML element and embedded the code. Question - is there a way to add the

<?php
session_start();
?>

to the page in RSD? I am assuming that this needs to be the first line on the page (I did have to do a .php page), or is this something that has to be manually added to the page every time a change is made?

Again, I appreciate the lesson and the assist on this.
User 187934 Photo


Senior Advisor
20,239 posts

You'll need to add the session start after export. It has to be the very first thing with no white space.
I have my sites setup to parse php inside html so I can get away with html pages. I have done a mix of html and php in sites. What I do is name my pages mypagename.php in SD so all I need to do is remove the .html that SD adds to the page name. Again this depends on how many links there are to that page whether I use that option.
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 2942998 Photo


Registered User
74 posts

Perfect, that's what I thought and I like the name.php practice, it seems it will help simplify the export and file renaming.

thanks again.

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.