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

  • SEARCH
  • Home
  • 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 8333705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:07:15+00:00 2026-06-09T03:07:15+00:00

I have two files [ Main.html ] and [image.php]. However [image.php] is dealing with

  • 0

I have two files [ Main.html ] and [image.php]. However [image.php] is dealing with binary data since it displays an image from the database. My question is can I and if i can how do I pass parameters into [image.php] from main?

I call image.php in main like this:

img src=”image.php” alt=”image retreived from DB”

<?php
$mysqli=mysqli_connect('localhost','root','','draftdb');
if (!$mysqli)
die("Can't connect to MySQL: ".mysqli_connect_error());


    $stmt = $mysqli->prepare("SELECT display.PICTURE_ID 
    FROM cards  
    INNER JOIN display ON cards.DISPLAY_ID = display.DISPLAY_ID 
    WHERE display.DISPLAY_ID=? AND cards.CARD_TYPE =?" );

     if( rand(1, 8) == 8) 
     {
     $cardtype='Mythic';
     $displayid=rand(1,15) ;

     }

     else
     {
     $cardtype='Rare';
    $displayid=rand(16,19) ;
     }

    $stmt->bind_param("si", $displayid, $cardtype);
    $stmt->execute();
    $stmt->bind_result($image);
    $stmt->fetch();
    header("Content-Type: image/jpeg");
    echo $image; 
    ?>
  • 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-06-09T03:07:16+00:00Added an answer on June 9, 2026 at 3:07 am

    Kind of hard to make a really detailed answer here, since the simplest solution is well… simple.

    Surely you’ve seen website addresses with ? and var=value&var2=anothevalue in them

    You can do the same thing yourself with.

    <img src="image.php?param=wat&moreparam=lolz" />

    and

    $param = isset($_GET['param']) ? $_GET['param'] : null;

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

Sidebar

Related Questions

Here's the deal - I have two files, main.html and processing.php. Within the php
I have two files 1 - index.php 2 - main.php index.php call to main.php
I have an HTML file which imports two files: graph.js and main.js The main
I have a two JavaScript files: Main.js Pmt.js I'm also using thick box (Ajax
Here I am trying to implement the jQuery I have two main files one
I have two frames in different files (main frame and settings frame), and I'd
I have two files client.php and server.php. The client file send a HTTP request
I have two plain html files. The first has a tree on the left
I have two files: Main.d and ImportMe.d . Their purposes should be self-explanatory. They
I have two XHTML files and my task is to convert from one to

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.