Forums

How do I add an image to my form?

boxcarmib 23 Jan, 2008
I'm a newbie.
I want to put a logo at the top of one of my forms, as well as display the image uploaded by a user.
i don't seem to be having a lot of success.
the complete directory path doesn't seem to work for uploaded images...
<img src="/home/content/m/a/g/magnoliaopen/html/components/com_chronocontact/upload/20080123010908_images.jpeg" width="346" height="474" />
<form id="form1" name="form1" method="post" 

is there something about joomla/chronoforms and images i don't know about?
anyone know what i'm doing wrong?
GreyHead 23 Jan, 2008
Hi boxcarmib,

This is an HTML question; I think that img tags need a URL to work and what you have there is an absolute path. Try this:
<?php
global $mosConfig_live_site;
$image_url = $mosConfig_live_site."/components/com_chronocontact/upload/
20080123010908_images.jpeg";
?>
<img src="<?php echo $image_url; ?>" width="346" height="474" />
That's not terribly elegant I'm sure that you can do more to look get the dimensions etc. But it should work OK.

Bob
boxcarmib 24 Jan, 2008
works great. thanks for the help!
This topic is locked and no more replies can be posted.