Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7176249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:28:09+00:00 2026-05-28T16:28:09+00:00

I have this form that pops up in a modal window like so: <?php

  • 0

I have this form that pops up in a modal window like so:

<?php
error_reporting(0);
require("../codebase/grid_connector.php");
include '../site_globals/dbc.php';
$mask5 = filter($_GET["var1"]);
//Get Category ID
$cat    = mysql_query("SELECT category FROM submissions WHERE submissions.submission_id='$mask5'");
$rows   = mysql_fetch_array($cat, MYSQL_ASSOC);
$array  = filter($rows['category']);
//Get Manufactuer ID
$man    = mysql_query("SELECT manufacturer_id FROM submissions WHERE submissions.submission_id='$mask5'");
$arows  = mysql_fetch_array($man, MYSQL_ASSOC);
$array1 = filter($arows['manufacturer_id']);
//Get All Submission ID's for this popup
$datum  = array();
$result = mysql_query("SELECT submission_id FROM submissions WHERE submissions.category='$array' AND submissions.manufacturer_id='$array1'");
while ($rowd = mysql_fetch_array($result, MYSQL_ASSOC)) {
    $datum[] = $rowd['submission_id'];
}
$datalist = implode($datum, ' , ');
$datalist = filter($datalist);
// Use Submission ID's to Get All Image ID's for this popup
$datum9   = array();
$datasql  = mysql_query("SELECT DISTINCT image_id FROM imagsub WHERE submission_id IN ($datalist)");
while ($row23 = mysql_fetch_array($datasql, MYSQL_ASSOC)) {
    $datum9[] = $row23['image_id'];
}
$datalist2 = implode($datum9, ' , ');
$datalist2 = filter($datalist2);
//Select filenames from images table that matches $datalist2 results
$sql = "SELECT * FROM images WHERE image_id IN ($datalist2)";
$resultz = mysql_query($sql);

?>
<html>
    <head>
    <title>Supplychex Vendor Dashboard</title>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body onLoad="doInitGrid();" marginwidth="0"; topmargin="0">

      <div style="width:100%; height:120px; background-image:url(../images/header.png)">
        <div style="float:left; width:30%; text-align:center">
        <form action="../php/pop_category_viewimages.php" method="post" name="MyForm" target="_blank" id="MyForm">
          <fieldset>
          <legend>Attachments</legend>
            <SELECT id="dropdown" name="dropdown" style="width:250px">
              <?php
                while ( $rowg = mysql_fetch_array($resultz, MYSQL_ASSOC) ){ 
                    echo '<OPTION value="'.$rowg['image_id'].'">'.$rowg['filename'].'</OPTION>'."\r\n";
                 }
            ?>
            </SELECT></br></br>
            <INPUT type="SUBMIT" name="SUBMIT" value="View">
            </fieldset>
          </form>

        </div>
       </body>
</html>

I have this action for this form set to this file:

<?php
define("DB_HOST", ""); // set database host
define("DB_USER", ""); // set database user
define("DB_PASS", ""); // set database password
define("DB_NAME", ""); // set database name
$link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Couldn't make connection.");
$db = mysql_select_db(DB_NAME, $link) or die("Couldn't select database");
$id = $_POST['dropdown'];
$query  = sprintf('select * from images where image_id = %d', $id);
$result = mysql_query($query);
$image = mysql_fetch_array($result);
header('Content-type: ' . $image['mime_type']);
header('Content-length: ' . $image['file_size']);
echo $image['file_data'];
?> 

I currently have a gif file and pdf file in the dropdown. Both gif and pdf work great on my desktop in all browsers. A new tab opens and displays either one. I just picked up a new laptop and eventhough Im using firefox 9 in both places when I run this on my laptop instead of simply displaying the pdf in a new tab the browser tries to download the pop_category_viewimages.php file. In IE on my laptop a new tab opens up blank. In chrome on my laptop the pdf opens up just fine. The gif opens fine in all browsers in all locations. Im totally thrown by this and hoping there is something I can adjust in my code to have the pdf open correctly in all browsers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:28:09+00:00Added an answer on May 28, 2026 at 4:28 pm

    It means you do not have a PDF reader installed. Chrome is the only browser (AFAIK) that has a PDF renderer built-in. Other browsers delegate this task to third party software like Adobe’s Acrobat Reader, which provide plugins that allow PDFs to be rendered directly in the browser. Lacking such available plugins, the only thing the browser knows what to do is to offer the file for download.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that looks like this: class SampleForm(forms.Form): text = forms.CharField(max_length=100) In
I have a form that looks kind of like this: <div> <div class=contact> <h1>Person's
I have asp.net form that contains fields. When I access this window, my javascript
I am fairly new to jQuery and I have this overlay window that pops
Well, I have a form that pops up in a modal dialog when a
Okay, so I have this form that is set to preload a DB record
I have a form that and after the user fills in this form, I
Please have a look at this form that I am trying to design with
I have this java servlet that grabs information from a form, I need to
I have this function to edit all fields that come from the form and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.