how can i include javasript in this code?

Discussion in 'PHP' started by user099, Aug 6, 2010.

  1. #1
    hi,
    i tried to put a javascript banner into my code, but it shows only error messages.

    the banner code:
    <script type="text/javascript" src="http://adhitzads.com/12345"></script> 
    Code (markup):
    here my code:
    <?php
    if($view=="home"){
    echo "
    <div class=\"w1 l\"><div class=\"box\"><h1 class=\"imem\"><img src=\"/templates/xyz/images/memicon.jpg\" alt=\"\" align=\"left\" /> Members Benefit</h1>
    <div class=\"text\">
    <p align=\"right\"><a href=\"index.php?view=join&amp;".$url_variables."\"><img src=\"/templates/xyz/images/clickhere.jpg\" alt=\"\" /></a></p>
    
      <b>some text</b>
    <ul>
    <li> here is some text.</li></ul>
    </div>
    
    </div>
    
    </div>
    <div class=\"w1 r\"><div class=\"box yellow1\">
    <h2><img src=\"/templates/xyz/images/sabicon.jpg\" alt=\"\" align=\"left\" /> some text</h2>
    <div class=\"text\">
    <p align=\"right\"><a href=\"index.php?view=prices&amp;".$url_variables."\"><img src=\"/templates/xyz/images/adverties.jpg\" alt=\"\" /></a></p>
    <b>some text</b>
    <ul>
    <li> also some text.
    </li>
    </ul>
    </div>
    
    </div>
    
    HERE i want to include the banner code!!!
    
    </div>";
    } ?>
    
    Code (markup):
     
    user099, Aug 6, 2010 IP
  2. extremephp

    extremephp Peon

    Messages:
    1,290
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just insert it where you have the text "HERE i want to include the banner code!!!"

    But i doubt the Javascript is a banner!!

    No!! It Wont be a banner at all!

    ~Exp~
    Need more? I Do paid Works !!
     
    extremephp, Aug 6, 2010 IP
  3. user099

    user099 Active Member

    Messages:
    218
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #3
    when i try to insert it. i will show me:

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/xyz/public_html/templates/xyz/layout.php on line 189
    Code (markup):
    the banner code is from an advertising network
     
    user099, Aug 6, 2010 IP
  4. krsix

    krsix Peon

    Messages:
    435
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    use <script type=\"text/javascript\" src=\"http://adhitzads.com/12345\"></script>
     
    krsix, Aug 6, 2010 IP
    user099 likes this.
  5. user099

    user099 Active Member

    Messages:
    218
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #5
    thank you very much. it is working.
     
    user099, Aug 6, 2010 IP