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 Link to comment https://forums.phpfreaks.com/topic/178489-solved-opening-a-specific-new-page/ 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? Link to comment https://forums.phpfreaks.com/topic/178489-solved-opening-a-specific-new-page/#findComment-941260 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>"; Link to comment https://forums.phpfreaks.com/topic/178489-solved-opening-a-specific-new-page/#findComment-941266 Share on other sites More sharing options...
Redgie Posted October 21, 2009 Author Share Posted October 21, 2009 Thank you very much! Link to comment https://forums.phpfreaks.com/topic/178489-solved-opening-a-specific-new-page/#findComment-941582 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.