Porkie Posted September 3, 2009 Share Posted September 3, 2009 i was wondering where iam goin wrong with this code? i normally work with <table> not <div> so any help will be greatly appreciated. echo '<div id="rightcol">'<SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.source2.co.uk"></SCRIPT>'</div>'; cheers Link to comment https://forums.phpfreaks.com/topic/173037-confused-with-divs/ Share on other sites More sharing options...
unknown1 Posted September 3, 2009 Share Posted September 3, 2009 Try this echo '<div id="rightcol">'; echo '<SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.source2.co.uk">'; '</SCRIPT>'; echo '</div>'; This code will work fine. Link to comment https://forums.phpfreaks.com/topic/173037-confused-with-divs/#findComment-912029 Share on other sites More sharing options...
thebadbad Posted September 3, 2009 Share Posted September 3, 2009 That won't work either, lol. It's actually pretty simple; just remove the single quotes from within your string: echo '<div id="rightcol"><SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.source2.co.uk"></SCRIPT></div>'; Link to comment https://forums.phpfreaks.com/topic/173037-confused-with-divs/#findComment-912033 Share on other sites More sharing options...
unknown1 Posted September 3, 2009 Share Posted September 3, 2009 That won't work either, lol. It's actually pretty simple; just remove the single quotes from within your string: echo '<div id="rightcol"><SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.source2.co.uk"></SCRIPT></div>'; echo '<div id="rightcol">'; echo '<SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.source2.co.uk">'; echo '</SCRIPT>'; echo '</div>'; This code will work fine but you're right in saying that if you remove the "" and add ' ' in it's place it will also work. or even '" . ' ' . " Link to comment https://forums.phpfreaks.com/topic/173037-confused-with-divs/#findComment-912045 Share on other sites More sharing options...
unknown1 Posted September 3, 2009 Share Posted September 3, 2009 Try this echo '<div id="rightcol">'; echo '<SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.source2.co.uk">'; echo '</SCRIPT>'; echo '</div>'; This code should work fine if not change all the " " to ' ' and the ' ' to " " e.g. echo "</div>"; Link to comment https://forums.phpfreaks.com/topic/173037-confused-with-divs/#findComment-912048 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.