Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,835
    Thanks
    21
    Thanked 157 Times in 148 Posts

    Arrow PHP "print" not generating output

    Can anyone see why the following PHP code won't output to the browser:

    PHP Code:
    print "<script type='text/javascript'>
        <!--
        function addTxt(what){
        document.add_line.messagetext.value = document.add_line.messagetext.value + what;
        document.add_line.messagetext.focus();
        }
        //-->
        </script>"
    ;

        print 
    "<div style='border:1px inset #FFF;height:35px;width:300px;padding-top:4px;margin:auto'>

        <a href='javascript:addTxt(' :)');'><img src='smileys/happy.gif' style='border:0;padding:2px;padding-left:0;margin:0;float:left;width:18px'></a>

        <a href='javascript:addTxt(' :(');'><img src='smileys/sad.gif' style='border:0;padding:2px;margin:0;float:left;width:18px'></a>

        <a href='javascript:addTxt(' ;)');'><img src='smileys/wink.gif' style='border:0;padding:2px;margin:0;float:left;width:18px'></a>

        <a href='javascript:addTxt(' :D');'><img src='smileys/really_happy.gif' style='border:0;padding:2px;padding-right:0;margin:0;width:18px'></a>

    </div>"

    Thanks.
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

  • #2
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,835
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Nevermind, it outputs fine, but now the javascript won;t work inside the PHP print statement.....It has something to do with how I'm nesting my quote marks, because the javascript works just fine normally....hellllppp, this is probably an easy question for somebody....
    Last edited by chump2877; 06-06-2005 at 08:10 PM.
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

  • #3
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,835
    Thanks
    21
    Thanked 157 Times in 148 Posts
    Nevermind, I fixed it, ya slackers lol
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Lol
    For something like tihs you could use a herodic syntax to write it in, I often do that if I need to embed an xml into my script and don't want to worry too much about the quotations, and stepping out of php won't work due to short tags.
    What is it that you ended up doing with it in case anyone else is suffering the same sort if situation?

  • #5
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts
    use ?>Your html tags<?php is what Fou-Lu means I think.
    CATdude about IE6: "All your box-model are belong to us"

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    no no, I mean herodic syntax, not php block levels:
    PHP Code:
    print <<<JAVASCRIPT
    <script type='text/javascript'> 
        <!-- 
        function addTxt(what){ 
        document.add_line.messagetext.value = document.add_line.messagetext.value + what; 
        document.add_line.messagetext.focus(); 
        } 
        //--> 
        </script>
         <div style='border:1px inset #FFF;height:35px;width:300px;padding-top:4px;margin:auto'> 

        <a href='javascript:addTxt(' :)');'><img src='smileys/happy.gif' style='border:0;padding:2px;padding-left:0;margin:0;float:left;width:18px'></a> 

        <a href='javascript:addTxt(' :(');'><img src='smileys/sad.gif' style='border:0;padding:2px;margin:0;float:left;width:18px'></a> 

        <a href='javascript:addTxt(' ;)');'><img src='smileys/wink.gif' style='border:0;padding:2px;margin:0;float:left;width:18px'></a> 

        <a href='javascript:addTxt(' :D');'><img src='smileys/really_happy.gif' style='border:0;padding:2px;padding-right:0;margin:0;width:18px'></a> 

    </div>
    JAVASCRIPT; 
    Last edited by Fou-Lu; 06-07-2005 at 04:53 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •