Announcement

Collapse
No announcement yet.

Problem with echo Function

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

    PHP Code:
    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

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

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

    Comment


    • #3
      It's Workiiiiiing!!!
      adz1111 you are a Genious.
      Thank you very much.

      Comment


      • #4
        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

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

        Comment


        • #5
          Hah! There is always that kafe! D'oh! :-)

          Comment


          • #6
            =P silly silly me right? >.<

            Comment


            • #7
              Why doesn't concatenation work?

              Comment


              • #8
                The answer was provided. Disregard.

                Comment

                Working...
                X