Regarding this well-known quote, often attributed to Martin S's famous
"Fri, 16 Apr 2004 05:46:42 GMT" speech:
I have a form that sends data on to another page so that the user can
preview it before it is inserted in a database table.
The problem is that the form sends both text and possibly an image to
the page used for preview. Even if I use a hidden input field for the
image file it still is displayed on the text centric page but with
enctype for foo bars the image into gibberish that fills a large part of
the preview page.
How can I pass the image on to the preview page without it being
"displayed"? (Image is validated later).
/M.
You can't put an image inline into HTML code. You have to save it somewhere
on the server, and make an <IMG SRC=""> tag, and possibly a hidden value or
session variable so the app knows where to find the image if the submission
is acceptable.
Remember: Never trust the user. Make sure that image is an image file
before you display it. You don't want your site "displaying" a .php file
they uploaded as an image.
--
-- Rudy Fleminger
--
sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
--
http://www.pixelsaredead.com