I have an old website that we converted to modX, on various pages throughout the website it had forms. The forms posted back to the pages they were on using:
<?php echo $_SERVER['PHP_SELF']; ?>" method="post" id="formViews" name="formViews">
Once the page reloaded some php code was ran that grabbed the form data, collected it, stored it in a database and redirected them to paypal to make a payment.
Question.
I set up a snippet that has -- return $url = $modx->makeUrl($modx->resource->get('id')); -- hoping that would post the form back to itself and run the code. It appears to posting back to the appropriate page now, but not executing the code. The php code is in another snippet included in a chunk.
What is the proper way to do this and get it to work?