This is a discussion on "Help with Javascript in php" within the PHP Forum section. This forum, and the thread "Help with Javascript in php are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Help with Javascript in php
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Help with Javascript in php
Hi everyone here has been very hepful in the past I was wondering if anyone could take a look at this code for me I am findiong php very difficult. I have created a flash menu with some software and I am trying to input this into my header script. This is the code I have
<?php $thisfile = "header.php";if(SHOWFILENAMES == "on"){echo "<p class=\"filename\">This file is: " . $thisfile . "</p>";}?> <!-- start of header.php --> <script type="text/javascript" src="flashobject.js"></script> <table bgcolor="white"> <tr> <img src="<?php echo INSTALLPATH;?>images/header.jpg" width="780" height="175" border=0 alt="<?php echo IMPLEMENTATION_NAME;?>"> </td> </tr> <tr> <td> <!-- table for icons - start --> <div id="color_id" >123 Flash Menu Placeholder.</div> <script type="text/javascript"> var fo = new FlashObject("/images/menu.swf", "color", "780", "244", "6", "#FFFFFF"); fo.addParam("menu","false"); fo.addParam("quality","best"); fo.addParam("salign","LT"); fo.addParam("scale","noscale"); fo.addParam("wmode", "transparent"); fo.write("color_id"); </script> <!-- table for icons - end --> </td> </tr> </table> <!-- end of header.php --> The softwre I have used has created a .swf file and a JScript Script File I have placed the swf in my images folder but I am unsure where to put the jscript file. If anybody could help me resolve this it would be fantastic. Please don't be to harsh if it is a very stupid mistake I am still a noob. Cheers |
|
|
|
|||
|
Re: Help with Javascript in php
Quote:
Note the bit of code I have highlighted above. This closing tag has no matching opening tag. |
|
|||
|
Re: Help with Javascript in php
Hi mate thanks for replying and yuor help before. I have realised php is not my strong suite. I am not suprised that the code is confused I am struggling with php. I have decided to work with htm in the large part as this is what I know. This is one of the last things I need to do with my php scripts. This is a template page which I include at the top of each of m php pages.
Example <?php include_once("templates/header.php");?> I am now only looking at using a small amount of php pages for my site and I am finally getting somewhere with it. Do you have any idea how i could clean this code up. I have been studying php but i really want to get my site up and running. I think it will take me a while longer to get my head round php. Again if you could help it would be much appreciated. Cheers |
|
||||
|
Re: Help with Javascript in php
Hey Martin.
I'm a little confused by this, because it's called "header" but there isn't any html markup. Don't you want the initial javascript reference in the <head>? Maybe not, this really just looks like a table you want to insert at some point. Hmm, I'm thinking maybe you want this include in the body but can't figure out how to get the javascript reference in the <head> section? If so, you need to echo a variable $showtable in the <head> section of the page.
I can't comment on the functionality of the code, but I have a couple of technique hints. There's nothing wrong with what you have, I just thought you might want to see a couple of other ways to do it.
Once you bother doing all the escaping work to have a passage in double quotes, there's no need to worry about concats (and vice versa). You're doing double effort. Either
I hope these hints are helpful (and correct, LOL). |
![]() |
| Tags |
| javascript, php |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| php and javascript | yvettesio | JavaScript Forum | 8 | Mar 14th, 2007 23:18 |
| JavaScript | cbrams9 | JavaScript Forum | 1 | Sep 20th, 2006 17:35 |
| using xml in javascript | shailu | JavaScript Forum | 0 | Jul 25th, 2006 07:36 |
| Can someone help me with this javascript | Galaxyblue | JavaScript Forum | 2 | Mar 11th, 2004 12:18 |
| what does \\ mean in javascript | jenjen1018 | JavaScript Forum | 5 | Jan 6th, 2004 17:05 |