are networking behaviors not working?

hey there, I have followed this tutorial and wasn't able to get the php script to write the files



I tried setting file permissions to 7 7 7, anyone else had the same issue?

Comments

  • uptimistikuptimistik Key Master, Member, Sous Chef, PRO Posts: 297
    edited June 2022

    Hi there! What you need to do is replace the following text with your server's directory and ensure that both the directory and file are set to permission 777.

    <?php

          error_reporting(E_ALL);

          if (!empty($_POST))

          {

                $paramsFile = '/your_directory_path/params.txt';

                $sigFile = '/your_directory_path/sig.txt';

                $sig = $_POST["sig"]; // this is the SHA1 checksum

                $params = $_POST["params"]; // This is the Json data you can work with

                $result = file_put_contents($paramsFile, $params);

                $result = file_put_contents($sigFile, $sig);

                echo '{"Status":"Success"}';

                // if there is a failure, return '{"Status":"Fail"}'

          }

          else

          {

                $paramsFile = '/your_directory_path/params.txt';

                $result = file_get_contents($paramsFile);

                if ($result === FALSE)

                {

                      echo '';

                }

                else

                {

                      echo $result;

                }

          }

    ?>

    GameSalad Templates and Custom Development at the Official Marketplace: http://gshelper.com

  • 95davidoliveira95davidoliveira Member Posts: 3

    Thank you so much, also important to note to place the PHP script file inside the same folder that you're writing the params and sig file.

Sign In or Register to comment.