I am using Joomla as a CMS for my website, and I am having some problems making my website fully W3C compliant when embedding a map on my page. The module I am using to embed a map uses this piece of code to embed the map.
<iframe height="<?php echo $module_height; ?>"
style="border:<?php echo $border; ?>;
width:<?php echo $module_width.$module_width_unit; ?>"
src="http://maps.google.com/maps?q=<?php
for ($loop = 0; $loop < $keywords_number; $loop += 1) {
echo $keywords[$loop];
if($loop!=$keywords_number_1) {
echo "+";
}
}
?>&ie=UTF8&view=map&f=q&saddr=<?php
for ($loop = 0; $loop < $keywords_number; $loop += 1) {
echo $keywords[$loop];
if($loop!=$keywords_number_1) {
echo ",+";
}
}
?>&<?php if($satellite) { ?>t=h&<?php } ?>output=embed"></iframe>
Unfortunately, this results in a return like this,
<iframe height="300" style="border:none; width:100%" src="http://maps.google.com/maps?q=STREET ADDRESS
CITY,+PROVINCE+POSTAL+CODE
&ie=UTF8&view=map&f=q&saddr=STREET ADDRESS
CITY,,+PROVINCE,+POSTAL,+CODE
&output=embed"></iframe>
The maps show up perfectly fine in the website, but I get this error,
Bad value for attribute src on element iframe: Tab, new line or carriage return found.
I would like this website to be fully W3C compliant, and I assume that I need all of the text in the output to be on one line.
Is there any way that I can force the for loops to print on the same line, or concatenate the output of the two loops into a string to stay on the same line?
Thanks!