473,385 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Generate dynamic images alongwith other html data.

I have a set of images on a server. I want to pick these from the
database without creating a

temporary file on the server; and also have some text alongwith it.

Something like,

ImageViewer.php
<?

print ( "<IMG SRC='GetImage.php?strImageId=1'>" );
print ( " some description about the image... " );

print ( "<IMG SRC='GetImage.php?strImageId=2'>" );
print ( " some description about the image... " );

....
....

?>

GetImage.php would server me with the image data from the database,
probably something like

this.
<?

.... Create database connection ...
.... Get image data from database depending on strImageId ...

header ( "Content-Type: Image/gif" );
print ( $image_data );

?>

GetImage.php gives the image alright.. ( I called
http://my_server.com/GetImage.php?strImageId=1

). However, what I want is a combination of both html and text.

Is it possible to acheive what I am trying to??

Any help would be greatly appreciated.

Regards,
Rithish.
Jul 17 '05 #1
3 2317
Rithish wrote:
I have a set of images on a server. I want to pick these from the
database without creating a

temporary file on the server; and also have some text alongwith it.

Something like,

ImageViewer.php
<?

print ( "<IMG SRC='GetImage.php?strImageId=1'>" );
print ( " some description about the image... " );

print ( "<IMG SRC='GetImage.php?strImageId=2'>" );
print ( " some description about the image... " );

...
...

?>

GetImage.php would server me with the image data from the database,
probably something like

this.
<?

... Create database connection ...
... Get image data from database depending on strImageId ...

header ( "Content-Type: Image/gif" );
print ( $image_data );

?>

GetImage.php gives the image alright.. ( I called
http://my_server.com/GetImage.php?strImageId=1

). However, what I want is a combination of both html and text.

Is it possible to acheive what I am trying to??

Any help would be greatly appreciated.

Regards,
Rithish.


A php script can either return HTML or an Image, not both. You'll have
to have two scripts, one to generate the HTML <img> tag and caption and
one to generate the image.

Alternatively you could use the image library to write the text on top
of the image.
Jul 17 '05 #2

"Rithish" <ri*****@dacafe.com> ???????/???????? ? ???????? ?????????:
news:fd**************************@posting.google.c om...
I have a set of images on a server. I want to pick these from the
database without creating a

temporary file on the server; and also have some text alongwith it.

Something like,

ImageViewer.php
<?

print ( "<IMG SRC='GetImage.php?strImageId=1'>" );
print ( " some description about the image... " );

print ( "<IMG SRC='GetImage.php?strImageId=2'>" );
print ( " some description about the image... " );

...
...

?>

GetImage.php would server me with the image data from the database,
probably something like

this.
<?

... Create database connection ...
... Get image data from database depending on strImageId ...

header ( "Content-Type: Image/gif" );
print ( $image_data );

?>

GetImage.php gives the image alright.. ( I called
http://my_server.com/GetImage.php?strImageId=1

). However, what I want is a combination of both html and text.

Is it possible to acheive what I am trying to??

Any help would be greatly appreciated.

Regards,
Rithish.


Try exclude you HTML tags from php-script like this
ImageViewer.php
<?php
.......
?>
<IMG SRC='GetImage.php?strImageId=1'>
<SPAN> some description about the image... </span>

<IMG SRC='GetImage.php?strImageId=2'>
<SPAN> some description about the image... </SPAN>
<?php
...
...

?>
Jul 17 '05 #3

"Dennis Biletsky" <uf***@ua.fm> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:c7***********@fortress.intercom.net.ua...

"Rithish" <ri*****@dacafe.com> ???????/???????? ? ???????? ?????????:
news:fd**************************@posting.google.c om...
I have a set of images on a server. I want to pick these from the
database without creating a

temporary file on the server; and also have some text alongwith it.

Something like,

ImageViewer.php
<?

print ( "<IMG SRC='GetImage.php?strImageId=1'>" );
print ( " some description about the image... " );

print ( "<IMG SRC='GetImage.php?strImageId=2'>" );
print ( " some description about the image... " );

...
...

?>

GetImage.php would server me with the image data from the database,
probably something like

this.
<?

... Create database connection ...
... Get image data from database depending on strImageId ...

header ( "Content-Type: Image/gif" );
print ( $image_data );

?>

GetImage.php gives the image alright.. ( I called
http://my_server.com/GetImage.php?strImageId=1

). However, what I want is a combination of both html and text.

Is it possible to acheive what I am trying to??

Any help would be greatly appreciated.

Regards,
Rithish.


Try exclude you HTML tags from php-script like this
ImageViewer.php
<?php
......
?>
<IMG SRC='GetImage.php?strImageId=1'>
<SPAN> some description about the image... </span>

<IMG SRC='GetImage.php?strImageId=2'>
<SPAN> some description about the image... </SPAN>
<?php
...
...

?>

By the way I have checked your variant and it works too. So if your script
doesn't work it happens due to another reason.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Snig | last post by:
Hi My application generates a HTML through XSL file according to some data from the database. This file have a number of images displayed in the HTML code. I need this HTML file to be...
1
by: Øyvind Isaksen | last post by:
Hello! I need to dynamic generate a SQL statement based on how many images a user select to upload. Here you see an example with 2 images. It can be up to 50 images and I dont want to write...
5
by: Tompa | last post by:
Hi, I would like to create images on the fly as a response to an http request. I can do this with PIL like this (file create_gif.py): from PIL import Image, ImageDraw print 'Status: 200 OK'...
3
by: JOSEPHINE ALVAREZ | last post by:
I have this code that I want to use to do a rollover. However, because the company I am doing it for is continually changing the text, I want to be able to use dynamic text to change the text on...
0
by: Snig | last post by:
Hi My application generates a HTML through XSL file according to some data from the database. This file have a number of images displayed in the HTML code. I need this HTML file to be...
12
by: Jim Michaels | last post by:
I need to generate 2 random numbers in rapid sequence from either PHP or mysql. I have not been able to do either. I get the same number back several times from PHP's mt_rand() and from mysql's...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
6
by: RoomfulExpress | last post by:
Here's the problem that I'm having- I'm trying to pull in 2 fields from my database and place them in the title of the HTML. I'm connecting to the db and selecting everything exactly the same as I am...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.