Forward doesn't contain data

drwbe8 years ago

Hi,

I have installed traccar on a digitalocean droplet and I try to get the information now using forward to my server / system.

This is my config file

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <!--

    This is the main configuration file. All your configuration parameters should be placed in this file.

    Default configuration parameters are located in the "default.xml" file. You should not modify it to avoid issues
    with upgrading to a new version. Parameters in the main config file override values in the default file. Do not
    remove "config.default" parameter from this file unless you know what you are doing.

    For list of available parameters see following page: https://www.traccar.org/configuration-file/

    -->

    <entry key="config.default">./conf/default.xml</entry>

    <entry key='database.driver'>com.mysql.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://localhost:3306/traccar?allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
        <entry key='database.user'>traccar</entry>
        <entry key='database.password'>password</entry>
        <entry key='forward.enable'>true</entry>
        <entry key='forward.url'>http://www.drw.be/live/data.php</entry>
</properties>

Traccar connects to that page on my server, but I don't get any data over there. This is the data.php script:

	$file = "log/".date('Y-m-d H:i:s').".txt";
    $myfile = fopen($file, "w") or die("Unable to open file!");
	fwrite($myfile,file_get_contents('php://input'));
	fclose($myfile);

What I get is an empty txt file...

Any idea how I can fix this?

Wouter

Anton Tananaev8 years ago

You should probably read documentation first:

https://www.traccar.org/configuration-file/