Note that there are some explanatory texts on larger screens.

plurals
  1. POLogging POST variables sent to a function
    text
    copied!<p>I am currently building a form that sends a user off to an external payment site at a certain point during the form. At this point I have provided two URLs to the service that is providing this payment service for me, one to call the function that will update a users record at the point of pyment, and a URL that a user is directed back to after the payment process is complete. The first URL (function call to update a users record) is "out-of-band" and will never be displayed to the user and will be from the server rather than client IP. Because of this I am in a bit of a 'blind-alley' as I cannot see the variables that are being passed back to me, and obviously these are important in order for me to parse and manipulate this data (post) in order to update our records.</p> <p>I have tried writing a simple algorithm inside my function that would loop through these POST variables and write them to a text file but unfortunately I couldn't get this working (maybe something to do with Joomla?).</p> <p>Here is that function:</p> <pre><code>public function harlandReturn() { $myFile = "text.txt"; $fh = fopen($myFile, 'w'); $stringData = ""; foreach($_POST as $i =&gt; $v) { $stringData .= $i . " : " . $v . " / "; } fwrite($fh, $stringData); fclose($fh); } </code></pre> <p>My main question is, is there a way i can get a function to log and store any data sent to it in a file, email or something similar so I can see what they are (ints, strings, boolean, etc) and their names?</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload