Not sure if this should be in Java or PHP... but I have a couple of java scripts (a scrolling banner and a news ticker) both written in java script - but I want to be able to change the text on both of them using a PHP inclue - but when I try and do it - it just messes up the java script! I think it's because I'm using <?php include 'text.txt'; ?> PHP: But the apostrophes cause the java script to end the line... so if I change the apostrophes to quote marks... I get the same problem. Would it be better to perhaps put <?php echo $contents ?> PHP: and then have <?php $file = "text.txt"; $contents = file_get_contents($file); ?> PHP: Somewhere else in the script - or would this not work?
Right - all sorted now... I was right... in my first post. I'm not sure what you mean by "Why you are calling javascript files from php it is better to cal through javascript." I'm not calling javascripts from php... I have javascripts in a php page and I want to call text documents within the java script... but by using file_get_contents and then using the echo to display them... I get over all y problems! I was having a stupid moment!