Hello,
I'm trying to include a PHP piece of code, based on an IF statement.
Basically, I have a popup window on my side (which gives further information about specifics). This in only needed on one page, but the <head> is in a differnet file. Page titles are assigned using <?php echo $_GET["title"] ?>, with ?title=blah in the URL.
Therefore, I would like to use Javascript to include my peice of code if the page title equals a specific one.
Here is the page i'm working on
http://www.alphalenzie.org.uk/talkti...=Talk%20Titles
Here is the piece of JS I put in the <head>:
Code:
<SCRIPT>
if(<?php echo $_GET["title"] ?>=Talk Titles){
document.write("<SCRIPT>
<!-- PopUp Link JavaScript Code Provided By: http://www.DesignerWiz.com - Development Resource & JavaScript Public Archive Center -->
function popUp(page,PWidth,PHeight,id) {
eval("designerwiz"+id+"=window.open('"+page+"','designerwiz1','toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=1,width="+PWidth+",height="+PHeight+"')")
}
</SCRIPT>")
}
else {}
</SCRIPT>
As you can see, this didn't work
i tried to get it to "write" the code there, but it was contained within a <script> tag alreadym and that probably screwed it up.
In conclusion, I'm trying to include a JS file, based on the fact that the page title is a specific name.
Second quesion: I will be making about 20 of these popups. This is a huge about of JS coding if each one is in the form:
Code:
<SCRIPT>
<!-- PopUp Link JavaScript Code Provided By: http://www.DesignerWiz.com - Development Resource & JavaScript Public Archive Center -->
function popUp(page,PWidth,PHeight,id) {
eval("designerwiz"+id+"=window.open('"+page+"','designerwiz1','toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=1,width="+PWidth+",height="+PHeight+"')")
}
</SCRIPT>
Is there any way to add popup IDs to this line of code? IE, would ...
Code:
"+page+"','designerwiz1','designerwiz2','designerwiz3','toolbar=0,
...
work?
Thanks in advance for any suggestions on this matter.
Hamish