View Full Version : php image upload shown in text area

07-15-2008, 02:19 PM

I know already how to upload files in PHP.

What I need to do is after uploading an image, to add it in a textareae on the same page.

If you didn't get me, this image should help:


Thank you!

07-15-2008, 08:18 PM
Use an empty/absent ACTION attribute in your FORM and, on the same page,<textarea><?php echo file_get_contents($path_to_upload); ?></textarea> (in an 'if' to determine if anything has been uploaded first).

(BTW, that image URL times out for me, and I'm on DSL.)

EDIT: The image finally loaded, and I don't think that's possible with a traditional textarea; you'll need to use an IFRAME or scrolling DIV for that. And if the user must type into the same thing, you're wanting a WYSIWYG script; see http://www.dynamicdrive.com/dynamicindex16/openwysiwyg/index.htm.

07-15-2008, 11:22 PM
ok, thank you

07-16-2008, 04:47 AM
Um, haven't tried it before. What about simply to give background to textarea with that image?

07-16-2008, 08:33 AM
It's a nice idea but I don't want it as a background

still thanks

07-17-2008, 06:50 PM
You can't place in image in a form feild, except as a background. You could try positioning it with CSS to make it look like it's in the textarea, I suppose.