Mixed PHP and Javascript challenge
Posted: Sat Mar 25, 2006 8:19 pm
Hi all,
I have to mix PHP and Javascript... (not that I want to... I prefer not to use Javascript), and I'm unable to get a task to complete...
I need to open a popup window with a larger version of an image for a product.
In a PHP include (called by productdetail.php) file I have variable created from a MySQL query and echo a HTML line back to productdetail.php....
My JavaScript File (dfdjavascript.js) reads:
I also have the the "use javascript file" tag in the <head></head> of productdetail.php
In the status bar I get "javascript:openpopup('bigpicture.php?strProductNumber=AAAAAA0001')" so I know that the php link code has echo'd properly.
I have also tested bigpicture.php by typing "bigpicture.php?strProductNumber=AAAAAA0001" into the address bar in IE and the page shows correctly, except not in a chromeless window as I want.
So, I conclude that the problem is with the Javascript. I don't know a lot about Javascript, so any ideas, PLEASE??? Maybe a type="" mismatch?
Also, is there a way to create a popup window with php? I really don't want to use JavaScript if I can help it.
Thank you in advance for any help.
Clinton
I have to mix PHP and Javascript... (not that I want to... I prefer not to use Javascript), and I'm unable to get a task to complete...
I need to open a popup window with a larger version of an image for a product.
In a PHP include (called by productdetail.php) file I have variable created from a MySQL query and echo a HTML line back to productdetail.php....
Code: Select all
...
$lnkLink = 'javascript:openpopup(\'bigpicture.php?strProductNumber='.$txtProductNumber.'\')';
...
...
echo '<a href="'.$lnkLink.'"><img src="images/pieces/set'.$numSet.'/'.$txtPicture.'/medium.jpg" width="150" height="150" border="0" align="top"></a></td>';Code: Select all
<script type="text/javascript">
function openpopup(popurl){
var winpops=window.open(popurl,"","width=500px,height=500px");
}
</script>Code: Select all
<script src="dfdjavascript.js" type="text/javascript"></script>I have also tested bigpicture.php by typing "bigpicture.php?strProductNumber=AAAAAA0001" into the address bar in IE and the page shows correctly, except not in a chromeless window as I want.
So, I conclude that the problem is with the Javascript. I don't know a lot about Javascript, so any ideas, PLEASE??? Maybe a type="" mismatch?
Also, is there a way to create a popup window with php? I really don't want to use JavaScript if I can help it.
Thank you in advance for any help.
Clinton