Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 27, 2012, 04:40:56 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Interested in joining the WebsiteBaker team?
For more Information read
here
or on our
new website
.
155555
Posts in
21715
Topics by
7737
Members
Latest Member:
gx-world
WebsiteBaker Community Forum
English
WebsiteBaker 2.x discussion
(Moderator:
Argos
)
Calling a PHP script from inside an <img src.. in code section
Pages: [
1
]
Go Down
Author
Topic: Calling a PHP script from inside an <img src.. in code section (Read 4372 times)
POPDUM
Offline
Posts: 23
Calling a PHP script from inside an <img src.. in code section
«
on:
February 02, 2008, 01:22:55 PM »
Hi,
I have to retrieve images stored as BLOBs inside of a MySQL DB, and then display them on a page.
Since these BLOBs need to be preceded by a header, I am trying to use a PHP script to output them on the screen. In my code section, I use a statement like:
echo '<img src="myscript.php?pic_num=2" />'; or echo "<img src=\"myscript.php?pic_num=2\" />";
No image is displayed in either case, and it is no wonder because when I see the image properties, it seems that an attempt is made to display myscript.php itself. Is there any way I can invoke myscript.php?
Or is there someone who has successfully implemented something like what I am trying to do.
Any help will be most appreciated!
Logged
Ruud
WebsiteBaker Org e.V.
Offline
Posts: 2298
Re: Calling a PHP script from inside an <img src.. in code section
«
Reply #1 on:
February 02, 2008, 05:38:24 PM »
You will have to tell the browser that a picture is being sent.
Before sending the image data, do the following in your PHP script.
Quote
header("Content-type: image/png");
(or image/jpg image/gif etc)
That should help.
Cheers,
Ruud
Logged
Professional WebsiteBaker Solutions
POPDUM
Offline
Posts: 23
Re: Calling a PHP script from inside an <img src.. in code section
«
Reply #2 on:
February 05, 2008, 10:37:44 AM »
Hi Ruud,
I am sending the content-type header, and it works when I try it from PHP/HTML, without the WB code section. Anyway, I resolved the issue by having the system store the images in files and storing the filenames in MySQL.
Thanks a lot for your help!
Logged
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...