blueovaltv Posted September 24, 2007 Share Posted September 24, 2007 Im trying to piece together some scripts and cant figure out why the hyperlinks will not open the image in a new window. It opens one like its going to work... then asks you to open or save the PHP file... Here is the page (pulling the thumbnails up using the same code) http://flcars4u.com/automall/carview.php?view=2 Here is the image.php script: <?php php_track_vars?> <?php if(!isset($Id)) { die("Need 'Id' parameter"); } else { $Id=addslashes($Id); } include("common.php"); //set up SQL connection $link = mysql_connect ($server, $user, $password); if (! $link) { die ("Couldn't connect to mySQL server"); } if (!mysql_select_db ($db, $link) ) { die ("Coldn't open $db: ".mysql_error() ); } $query = "SELECT filetype, bin_data FROM tbl_Files WHERE id_files='$Id';"; $result = mysql_query($query); $query_data = mysql_fetch_array($result); $bin_data = $query_data[bin_data]; $filetype = $query_data[filetype]; Header("Content-type: $filetype"); echo $bin_data; ?> Quote Link to comment https://forums.phpfreaks.com/topic/70538-imagephpid-question-will-not-open-in-a-new-window/ Share on other sites More sharing options...
Dragen Posted September 24, 2007 Share Posted September 24, 2007 It works fine in firefox. Just ie that doesn't seem to like it. Quote Link to comment https://forums.phpfreaks.com/topic/70538-imagephpid-question-will-not-open-in-a-new-window/#findComment-354368 Share on other sites More sharing options...
BlueSkyIS Posted September 24, 2007 Share Posted September 24, 2007 doesnt' work in safari either. you need to send more headers indicating the name of the file. Also exit; after you echo the data and remove any spaces there may be before the first <?php and after the last ?> Quote Link to comment https://forums.phpfreaks.com/topic/70538-imagephpid-question-will-not-open-in-a-new-window/#findComment-354372 Share on other sites More sharing options...
blueovaltv Posted September 24, 2007 Author Share Posted September 24, 2007 You both have me working in the right direction.. thanks.. Downloading firefox and safari now Quote Link to comment https://forums.phpfreaks.com/topic/70538-imagephpid-question-will-not-open-in-a-new-window/#findComment-354441 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.