Hamish Dunn
Hello, We use a contact us button with Sourcerer (12.0.2) and PHP (8.4.5) code to send the product our visitor is viewing to our contact form that is located on a separate page as part of the URL.
For example, if the visitor was on a page with a URL like
https://www.exampledomain.com/Example-Product-Name
and they clicked on the "Contact Us About This Product" button that normally sent the following URL to our contact page so that it is captured when they submit the rest of their information:
https://www.exampledomain.com/index.php/contact-us?requested_model=Example+Product+Name
This method was previously working well up until the recent update to Joomla 5.2.5 Any suggestions are very much appreciated.
Code we are using for the contact button that is no longer working:
<a class="btn btn-info goldbtn" href="index.php/contact-us?requested_model={source}[[?php $arrURI = explode('/', $_SERVER['REQUEST_URI']);
echo(urlencode(ucwords(str_replace('-', ' ', $arrURI[count($arrURI) - 1])))); ?]]{/source}" style="width: 100%; max-width: 400px;"><span class="fa fa-envelope-o"></span> Contact Us About This Product</a>
The resulting URL after the last update is now showing like this
https://www.exampleurl.com/index.php/contact-us?requested_model=[[?php%20$arrURI%20=%20explode(%27/%27,%20$_SERVER[%27REQUEST_URI%27]);%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo(urlencode(ucwords(str_replace(%27-%27,%20%27%20%27,%20$arrURI[count($arrURI)%20-%201]))));%20?]]