sazzie Posted January 18, 2007 Share Posted January 18, 2007 I have a problem setting up what is supposed to be a simple string. The code is as follows:[code]echo "<br> before declaration : ".$javascript; $javascript = "<SCRIPT LANGUAGE=\"JavaScript\" SRC=\"CalendarPopup.js\" type=\"text/javascript\"></SCRIPT> <SCRIPT LANGUAGE=\"JavaScript\" type=\"text/javascript\"> var cal = new CalendarPopup(); </SCRIPT>";# $test = "test string";echo "<br> after declaration : ".$javascript; [/code]The problem is the $javascript object still contains nothing when execution reaches the second echo call.If I uncommented the $test object and attempt to echo it, that will display fine.Can you advice me on what the issue and solution is please? Link to comment https://forums.phpfreaks.com/topic/34706-php-string-encoding-help/ Share on other sites More sharing options...
JJohnsenDK Posted January 18, 2007 Share Posted January 18, 2007 This looks very not normal:#$test = "test string";Shouldnt it be $test = "test string"; ?? Link to comment https://forums.phpfreaks.com/topic/34706-php-string-encoding-help/#findComment-163560 Share on other sites More sharing options...
sazzie Posted January 18, 2007 Author Share Posted January 18, 2007 Yes it should - if you were using that particular line.It is only there for people who want to execute the code.The real problem is the $javascript = <SCRIPT .....That piece of code does not return any text in $javascript .... ??? Link to comment https://forums.phpfreaks.com/topic/34706-php-string-encoding-help/#findComment-163563 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.