First, I am not a php coder so I don't have a clue as to why the following is happening.
I have some php files that a developer created that I use to to a find in Filemaker Webdirect. The php files are suppose to create a connection with Filemaker and display the find in Webdirect.
All of a sudden as of yesterday, running the php script redirected the browser to <http://www.searchingresult.com/?pid=9POLWR59T&dn=smilepix.i.com.com&rpid=9POKA9272>

The php script has three files: fm\_link.php, fm\_read.php and fm\_write.php that run in that order.

To try and resolve the issue I tried a few things. 

1. try and run the script from another computer - same result as above.
2. Place the php scripts on another domain - same result as above.

Here are the script that are run:
fm\_link.php

```
    <?php

session_start();

// default parameters, if not passed
$fmurl = ''; // enter the address of the server hosting webdirect
$fmfile = ''; // enter the default file to open

if (isset($_GET['fmurl'])) {
    $fmurl = $_GET['fmurl'];
}
if (isset($_GET['fmfile'])) {
    $fmfile = $_GET['fmfile'];
}

// store all GET paramters in a session
if (isset($_GET) && count($_GET) > 0) {
    $_SESSION['get_requests'] = $_GET;

}

// redirect to WebDirect Session
header('Location: http://' . $fmurl . '/fmi/webd#' . $fmfile );

```

fm\_read.php

```
<?php

// check for required parameter, should match the UUID passed in fm write file.
if(isset($_GET['file_uuid']) && strlen($_GET['file_uuid'])>0 ){

    $filename_string = filter_var($_GET['file_uuid'], FILTER_SANITIZE_STRING);

    $fn = '/tmp/'.$filename_string.'.txt';

    $fr = fopen($fn, "r") or die("Unable to open file!");
    echo fread($fr, filesize($fn));
    fclose($fr);

    unlink($fn);  // remove the file once read

} else {

    exit('Error: No file.');

}

```

fm\_write.php

```
    <?php

    session_start();

    // only write to file if we get the correct parameter "file_uuid"
    if (isset($_GET['file_uuid']) && strlen($_GET['file_uuid']) > 0) {
        // save temp file with uuid from server. sanitize the file_uuid parameter
        $filename_string = filter_var($_GET['file_uuid'], FILTER_SANITIZE_STRING);
        // add extension for writing
        $filename = $filename_string . '.txt';

        // set session variables to a string to write
        //initialize string
        $string = '';
        // set each parameter as local variable
        foreach ($_SESSION['get_requests'] as $key => $value) {
            if ($key == 'fmurl' || $key == 'fmfile') {
                // do not store these two parameters
            } else {

                // store as variables
                $string .= '$' . urlencode($key) . ' = "' . urlencode($value) . '"; ';
            }
        }

        // write the file to temp
        $fn = '/tmp/' . $filename;
        if ($fn) {
            $f = fopen($fn, 'w+');
            if ($f) {
                $fw = fwrite($f, $string);
                if ($fw) {
                    echo 'wrote file.'; // . $fn
                    // once file is written, destroy session
                    session_destroy();

                } else {
                    echo 'write error';
                }
            } else {
                echo 'open error';
            }
        } else {
            echo 'file error';
        }
    } else {

        exit('nothing to do.');
    }

```

I am at a standstill with this and do not know what to do.

Thanks in advance for your help - Sam