Have been trying to figure this out all day assuming its just a small error.....
I\'m trying to use the file_put_content to put a variables value into anoth
Change the single quotes surrounding the string you are writing to the file to doubles quotes. So:
file_put_contents("/home/files/1/741/html/WP/$GDI_user/config.php",'
$affiliate_reference = "$UNQ_ID";
echo $UNQ_ID;
?>');
...becomes...
file_put_contents("/home/files/1/741/html/WP/$GDI_user/config.php","");
A couple of thoughts on this operation
instead of as short tags are not supported everwhere and are disabled by default on new PHP installations\r, \n, \r\n and the PHP_EOL constant instead.