How to set a automatically base url?

i dont know whether u got my problem or not.
but i wrote this in autoload.php
code as

$autoload['helper'] = array('url');
and then from my main view
i wrote the image tag as
<img src="images/catch-me.gif">
now images are gone they are not visible.
but now if i write
<img src="$base/images/catch-me.gif">
(off course $base echoed in php tags but when i write here it wont show because of form filters of forum)

typ a "/" before images in your source

i did that but actually its not taking that also same problem persists even after adding

really...:S then eeuhm..I mean what your map structure?
its working fine for me...:S

even i dont know whts happening

If you "View Source" of the resulting page, what do you see in the <img> tag? If you put that image URL in your browser does it show the image?

in my view source i can see
<i m g src='images/ctachme.gif'>
but logically i must be able to see my image
as i have set the base url in my base tag

Where is your images directory? Is it at the same level as your "/system/" directory?

Your directory structure should be something like:

Can you view your image in your browser just with the URL:

Are you rewriting your URLs in an .htaccess file to get rid of the "index.php" in your URLs?

Also, you might try everything without &lt;base&gt; tags (which are generally unnecessary).

Finally, if you put your code in "code" tags, the forum software will not filter it and it will be easier to read.

actually i can see the images when i browse url

Also i have the directory structure as mentioned.
But i did not get the point of .htaccess.
i use a wamp server. Can u tell me what have to be changed in .htaccess file.?

Also i used the code tag to write the tags still the same problem was persisting.

Is your page publicly available so we could see it?

Can you try removing any &lt;base&gt; tags.

Does it work if you hardcode the <img> src to "/images/myimage.gif" or ""?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.