Jump to content

confused with divs?


Porkie

Recommended Posts

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.