0
<?php
/**
*
* @ Author   : AtakanCan 
*
**/

error_reporting(0);
$install_directory_name = 'idevaffiliate';

if (!isset( $_SERVER['DOCUMENT_ROOT'] )) {
    $path = $_SERVER['DOCUMENT_ROOT'] = 
    str_replace( '\' , '/' , 
    substr
    ( 
    $_SERVER['SCRIPT_FILENAME'], 0, 0 -
    strlen( $_SERVER['PHP_SELF'] ) ) );
} 
else {
    $path = $_SERVER['DOCUMENT_ROOT'];
}

$path = $path . '/' . $install_directory_name;
include( $path . '/API/data.php' );
?>

I get the T_string error on the below line. I don't know what is the error behind this, please someone let me know.

$_SERVER['SCRIPT_FILENAME'], 0, 0 -
Oldskool
  • 34,211
  • 7
  • 53
  • 66

1 Answers1

2

You have an escaping issue.

In your str_replace you have '\' as the first parameter. The \ escapes the closing quote. Replace it with '\\' instead, to search for a literal \.

Oldskool
  • 34,211
  • 7
  • 53
  • 66