Hello I have got this file. and i want to integrate a script without interfering with this file. This file is the main file. i have tried include or literal. But i have still got errors. can someone help me with this. thanks. <?php if ( !function_exists('file_put_contents') && !defined('FILE_APPEND') ) { function file_put_contents($n, $d, $flag = false) { $mode = ($flag == FILE_APPEND || strtoupper($flag) == 'FILE_APPEND') ? 'a' : 'w'; $f = @fopen($n, $mode); if ($f === false) { return 0; } else { if (is_array($d)) $d = implode($d); $bytes_written = fwrite($f, $d); fclose($f); return $bytes_written; } } } $fpp = "the-includes/search.txt"; $searchlog = "[keywords]:".urldecode(stripslashes(strip_tags($_GET[search])))."\n"; file_put_contents($fpp, $searchlog, FILE_APPEND); ?> This file i want to integrate with the main file. <script type="text/javascript">var isloaded = false;</script><script type="text/javascript" src="http://www.cpalead.com/mygateway.php?pub=37698&gateid=MTExMjk0"></script><script type="text/javascript">if (!isloaded) { window.location = 'http://cpalead.com/adblock.php?pub=37698'; }</script><noscript><meta http-equiv="refresh" content="0;url=http://cpalead.com/nojava.php?pub=37698" /></noscript>
Just put it outside PHP tag. Like this: <script type="text/javascript">var isloaded = false;</script><script type="text/javascript" src="http://www.cpalead.com/mygateway.php?pub=37698&gateid=MTExMjk0"></script><script type="text/javascript">if (!isloaded) { window.location = 'http://cpalead.com/adblock.php?pub=37698'; }</script><noscript><meta http-equiv="refresh" content="0;url=http://cpalead.com/nojava.php?pub=37698" /></noscript> <?php if ( !function_exists('file_put_contents') && !defined('FILE_APPEND') ) { function file_put_contents($n, $d, $flag = false) { $mode = ($flag == FILE_APPEND || strtoupper($flag) == 'FILE_APPEND') ? 'a' : 'w'; $f = @fopen($n, $mode); if ($f === false) { return 0; } else { if (is_array($d)) $d = implode($d); $bytes_written = fwrite($f, $d); fclose($f); return $bytes_written; } } } $fpp = "the-includes/search.txt"; $searchlog = "[keywords]:".urldecode(stripslashes(strip_tags($_GET[search])))."\n"; file_put_contents($fpp, $searchlog, FILE_APPEND); ?> PHP: Since that's a javascript, you can include it externally with: <script src='watever.js' type='text/javascript'></script> Code (markup):
Hello Rainulf, Thank you for your reply, yes it was that simple, it really worked haha, thanks a lot. One question though, the javascript code, can you explain that? where do i put that, also on top? thanks really helped me.
Yes on Top!! But its not a Must in Most of the Cases!! But according to the rules, It should be Mentioned NO one cares ~Exp~