WordPress - passing form values to a download manager - php

CONTEXT
We are creating a Wordpress site that allows users to log-in, select a resource, fill out a form, and then download a PDF that is stamped with the information filled out on the form. We are currently using the Wordpress Content Manager plugin on a Genesis child theme to manage downloads. This plugin has the functionality to control access to files, make a download button conditional on filling out a form and stamp a PDF with static information about the user. The workflow should look like this:
User selects resource from a list
User is taken to a form and fills it out
On form submission, user is taken to a download page where a download link for this resource's PDF is available
The PDF is downloaded, stamped with information that the user filled out on the form in the previous step.
PROBLEM
We would like to pass information from the form to the PDF stamper. However, there is not native functionality that allows this. The plugin is limited to stamping information that is in the user's profile. We are wondering what the simplest way of passing data from a form back to the plugin might be.

Related

Showing gated and ungated content based on form submission

I have a HubSpot form embedded into a WordPress page.
What I'm trying to achieve is gated and ungated content. See these use cases as an explanation:
User enters WordPress page for the first time on content that is gated by default (by gated
I mean it shows a form).
User fills out the form and gets redirected to whatever is specified as the redirect
option in HubSpot (the content is now ungated).
User closes the window but decided to back onto the WordPress page. Now, since the
user has already filled out the form (the cookie for hubspotutk
exists), I want the user to be redirected straight to the asset
(whatever is specified in the redirect option in HubSpot forms).
How far have I got?
I've created an ACF field in WordPress with radio buttons for Gated or ungated content. By default, all content is ungated.
I've then set a cookie based on this ACF field value. I.e. if the content is gated, resourceType cookie equals "Gated".
That's how far I have got.
The next steps (I think) would be to...
Only "ungate" the page if the user has filled out that form. For example, I've completed a form, the hubspotutk cookie value is "23a43a4a6de9c38f7657ebd08d574scf". How does HubSpot know which form this value is assigned to?
Other concerns:
If the user has filled out the form already, how to I redirect them straight to the asset? Is there a way to get the "redirect to another page" value in the image below as a variable?
I don't want to use HubSpot Forms API because I don't expect the admin to create the forms via the API. They'll want to create it via the HubSpot forms option.
Any ideas?

Email before download, fill form once download document

The warning on point 5 of downloads page is a plugin error. I did log a support ticket about this but it has not had a response - https://wordpress.org/support/topic/email-before-download-error-php/
I use a Email before download plugin, Contact form 7 plugin.
We need a popup form to appear when you click a download button (it is doing this now). but then if you want to download a 2nd or 3rd document in the same session, you shouldn’t have to fill out the form again as all the details will be the same and it would be very annoying to the customer so the user should be allowed to download as many documents as they want, after entering the details after the first download.
How do I do this?

How to use php in wordpress template to modify on-page details?

There must be a standard answer to this question which must come up all the time, but I haven't been able to find the solution.
I am trying to set up the return page from a PayPal payment on a Wordpress site. I have a button on the sales page which sends the transaction to PayPal and once completed PayPal sends POST data back to a url for a page that I specify on my site.
The responding page on my site needs to perform a confirmation handshake with PayPal, read the POST data, email me with the details, and display a table to the customer with the details. All except the last action can easily be done with php, but displaying the table (which should be the easiest) is where I'm stuck.
I have a draft "Thank you for your order" page on standard page in Wordpress. I have created a custom template file which can be selected from the Templates dropdown selector on the Edit page. The custom template can host the php code to perform the handshake, get the POST data and email me with the details.
However, the template (which is a copy of the Atahualpa theme's index.php file) renders the page by various Wordpress function calls, and I don't want to interfere with those. However, this means that I can't directly control the page rendering using echo commands in php. With javascript or jquery I could allow the page to load and then modify the innerHtml, but this seems to be a clumsy way of doing it, and it would probably be visible to the user, as page elements are first rendered then modified.
What's the best way to do this?

Keeping form fields after FPDF/FPDI generation

I've scoured the forums/web for this answer, but I've failed to come up with a solution.
I have a PHP based form that inputs form data onto a PDF generated by FPDF/FPDI (utilizing a pre-made template). That, in and of itself, is working just fine.
I have one version that is a simple quote; the user can input their email without adding in personal information if they're not ready to move forward. A PDF is created with their quote info. The question has come up on whether or not this generated PDF can have form input fields and a send button, that way the client can send along their newly completed form with their quote information.
Does anyone know of a utility out there that can generate a functional PDF with input fields/send button and also input data from a PHP form?
Whoever can help will be this girl's hero. I may even send you cookies.

Php form for registered users in joomla

I am using joomla cms for my website, I need to add a php form for example to edit their profile details of registered users. I have created a separate php form to do so. I could use the wrapper module to display this form for registered users. But when i copy the link for ex, http://localhost/joomla/edit-your-profile.php , public user can still view and use that form. So I need to check whether user logged in or not using session/$my variable details. Is it possible?
SEE Joomla Login Session Tutorial
(via Custom Sessions with Joomla which should also be helpul.
You can also use a form builder. You will only need to create a PHP form by means of an intuitive interface and generate a code that can be easily copied and pasted to any web page.

Categories