Problem with echo Function

Hi,
I’m really new to PHP and Scriptcase and this may be easy for most of you but i am stucked since 2 hours on this.
I am trying to add html to a grid application page with the echo function.

This is the code i put in onScriptInit Event

echo 
'<div class="scGridBorder">'+
'<table width="100%" cellspacing="0" cellpadding="0">'+
'<td style="padding: 0px"> HELLO WORLD!'+
'</td></tr></table>'+
'</div>';

As result this is printing 00 on the page.

Another issue is that i think onScriptInit is executing Twice, that’s why i have 00 and not 0 printed.

Thank you very much for any tip you can give me.
Regards,

Maxi

Try splitting it out rather than concatenate as a single string - this is from a grid app’s onScriptInit I have:

echo '<style type="text/css">';
echo '.scGridFieldEvenFont { vertical-align: middle; }';
echo '.scGridFieldOddFont  { vertical-align: middle; }';
echo '</style>';

It’s Workiiiiiing!!!
adz1111 you are a Genious.
Thank you very much.

actually your problem was the + sign… remember that in PHP u concatenate using a single dot ( . ) being this the case you should use somehting like


echo '<div class="scGridBorder">' .
'<table width="100%" cellspacing="0" cellpadding="0">' .
'<td style="padding: 0px"> HELLO WORLD!' .
'</td></tr></table>' .
'</div>';  

Regards

Hah! There is always that kafe! D’oh! :slight_smile:

=P silly silly me right? >.<

Why doesn’t concatenation work?

The answer was provided. Disregard.