Including Javascript into PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tranceplante
Forum Newbie
Posts: 2
Joined: Tue Sep 16, 2008 12:01 pm

Including Javascript into PHP

Post by tranceplante »

hello guys.... well basically I don't know where to look so I created an account here to ask the experts a little bit of help. I am playing with a nice little cms called pluck and I am trying to incorporate a javascript that most of you might know called mootools FX slide.

I created a DIV on top of the header to try and get it to work, but I think the problem is that I can't load the Javascript
(it's the black box on top of the page here http://www.creativeme.ca/pluck )

So I created the #contact box(by css) which is on top of everything and I am trying to include the code there(see ADD CODE HERE)

Code: Select all

$html_in_head = "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />
<link rel=\"stylesheet\" type=\"text/css\" href=\"$themedirectory/menu.css\" />";
 
$html_menu_start = "<div id=\"headercontainer\"><div id=\"contact\">ADD CODE HERE</div><div id=\"header\">
<h1>$sitetitle</h1>
</div>
</div>
<div id=\"menucontainer\">
<div id=\"menu\">
<div id=\"navcontainer\">
<ul id=\"navlist\">";
I am trying to add this code:

Code: Select all

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="demo.css" type="text/css" />
    <script type="text/javascript" src="../mootools.js"></script>
    <script type="text/javascript" src="demo.js"></script>
    <title>Fx.Slide Demo</title>
</head>
<body>
        <h3 class="section">Vertical</h3>
    <div class="marginbottom">
        <a id="v_slideout" href="#">slide out</a>
        |
        <a id="v_slidein" href="#">slide in</a>
        |
        <a id="v_toggle" href="#">toggle</a>
        |
        <a id="v_hide" href="#">hide</a>
        |
        <a id="v_show" href="#">show</a>
        | <strong>status</strong>: <span id="vertical_status">open</span>
    </div>
    <div id="vertical_slide">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </div>
    </body>
basically I can add all the stuff correctly and link to the css, but I can't seem to include the Javascript the right way.

Any help?
tranceplante
Forum Newbie
Posts: 2
Joined: Tue Sep 16, 2008 12:01 pm

Re: Including Javascript into PHP

Post by tranceplante »

Actually i just thought of something? How about I add an include line to point to an HTML file on the main index.php

I have no time to work on it at this momment, but would that do it?
Post Reply