Redgie Posted October 21, 2009 Share Posted October 21, 2009 Hi there, I'm currently using a drop down menu to select which image to open in a new window. So basically when they select something, the selection is posted round and converted to another vlaue (This is all irrelevant). The end product is a number, E.G. 401, which references an image, E.G. Vehicle_401.jpg. So I need the selection to open a new window displaying Vehicle_401.jpg This is what I have currently, $model is the value being posted: echo "<script type=\"text/javascript\">\n"; echo("window.open($model, 'example', config='height=400,width=400')"); echo("</script>"); However this redirects to page "www.re...../cpanel/401" whereas I need it to be "www.re...../cpanel/Vehicle_401.jpg" I have tried assigning a new variable called $address which combines the 401 variable and a series of additions such as 'Vehicle_'.$model but none of these seem to help, they simply stop the external page opening! Best Regards and thanks in advance for your help Quote Link to comment Share on other sites More sharing options...
Redgie Posted October 21, 2009 Author Share Posted October 21, 2009 Just had another look and it seems like if I try to set target web address to go to as a variable containing a number it is fine, but if I try to set it as a string, it doesn't work. Is there any specific reason for this? Quote Link to comment Share on other sites More sharing options...
mattal999 Posted October 21, 2009 Share Posted October 21, 2009 This should work: echo "<script type=\"text/javascript\">"; echo "window.open('Vehicle_".$model.".jpg', 'example', config='height=400,width=400')"; echo "</script>"; Quote Link to comment Share on other sites More sharing options...
Redgie Posted October 21, 2009 Author Share Posted October 21, 2009 Thank you very much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.