You are obviously integrating an external service on the page. That’s why I’m a little surprised by your question. Are you asking if you can call up the WordPress URL of the page with parameters that are then passed on to this external service? If so, you would first need to clarify whether this external service can handle this at all. Because when I tried it, it didn’t work (without using your site at all).
If this is exactly your goal, the next question would be how you pass the parameters from the WordPress URL to this integration. Surely you will have written your own PHP code for this?
The issue isn’t calling up the parameters. That part works fine and yes it does use custom PHP (which I’ll attach at the bottom of this). The issue is before that.
- I’m using Fluent Forms to create a multi-step form. I want to pass two variables (the name and email from the form) onto the page: staging.makebusinessmatter.com/brand-strategy-qualify. This is so that the embedded form there can Prefill the name and email fields so the person doesn’t have to enter them in again.
- So, once they submit the form in fluent forms, I have it set to direct them to: staging.makebusinessmatter.com/brand-strategy-qualify?name={inputs.firstname}&email={inputs.email}. Here the {inputs.firstname} is what they entered into the form for a name and the {inputs.email} is what they entered into the form for an email.
- For the sake of example, assume:
Name: Jim
Email: [email protected]
- This populates the URL as: staging.makebusinessmatter.com/brand-strategy-qualify?name=Jim&email=jim%40gmail.com
- I get a Page Not Found error when that page loads.
- staging.makebusinessmatter.com/brand-strategy-qualify loads fine without the appended parameters.
- So, the problem is that It’s not recognizing that “staging.makebusinessmatter.com/brand-strategy-qualify?name=Jim&email=jim%40gmail.com” should be loading “staging.makebusinessmatter.com/brand-strategy-qualify” and that the ? and stuff after it are just variables, not a different page. I’m not sure why this is happening.
- So the incorrect page is loading, so the PHP script can’t pull the proper information. So the issue isn’t with the PHP script that’s pulling the parameters into the form. It’s getting the page to load properly as detailed in #7.
I know the php code works fine because I can get all of the above to work fine and populate the field the way I want if I get it to load:
https://staging.makebusinessmatter.com/post.php?post=498&name={inputs.firstname}&email={inputs.email}. Where post=498 directs to the same page that /brand-strategy-qualify directs
Here’s the PHP code, even though it isn’t related to the issue I’m having:
<!-- Placeholder for the embedded Calendly form -->
<div id="calendlyEmbedContainer"></div>
<script>
// Function to retrieve URL parameters
function getUrlParameter(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
var results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
// Retrieve name and email from URL
var name = getUrlParameter('name');
var email = getUrlParameter('email');
// Construct Calendly URL with prefilled parameters
var calendlyURL = "https://calendly.com/makebusinessmatter/product-demos?name=" + encodeURIComponent(name) + "&email=" + encodeURIComponent(email);
// Embed Calendly form
var calendlyScript = document.createElement('script');
calendlyScript.setAttribute('src', 'https://assets.calendly.com/assets/external/widget.js');
calendlyScript.setAttribute('async', 'true');
document.getElementById('calendlyEmbedContainer').appendChild(calendlyScript);
// Create the Calendly inline widget
var calendlyInlineWidget = document.createElement('div');
calendlyInlineWidget.setAttribute('class', 'calendly-inline-widget');
calendlyInlineWidget.setAttribute('data-url', calendlyURL);
calendlyInlineWidget.setAttribute('style', 'min-width:320px;height:700px;');
document.getElementById('calendlyEmbedContainer').appendChild(calendlyInlineWidget);
</script>
-
This reply was modified 2 years, 3 months ago by
mfkfisher.
-
This reply was modified 2 years, 3 months ago by
mfkfisher.
Can you try this without a Brizy template? You could then rule this out as the cause of the problem. If Brizy turns out to be the cause, contact their support forum: https://ww.wp.xz.cn/support/plugin/brizy/
I created a page without installing the Brizy editor on that page. Still getting the same error.
A Blocksy template is then (presumably) used. I would recommend you to ask their support: https://ww.wp.xz.cn/support/theme/blocksy/
The same error was present when I used thte twentytwentyfour theme. I switched to blocksy because it was one that Brizy recommended, in hopes that it would fix the issue. But it didn’t. I guess I’ll try reaching out to them though.
Just leaving this here so nobody else responds. I found a fix by accident this morning. It seems calling the parameter “name” is causing the issue. If I name the parameter anything else, like “first_name” it works fine.
That would explain the issue someone from my web host had. They entered in (Test) as their name and the form directed them to a /test/ page I had set up.
So, not sure what’s causing it, but I did fix it.