i don't see any images on my site - image

In localhost (Xampp) I created a website folder, there are index.html, css, php and a folder with images. I wrote a link to the image I want to be in the index.html
< body >
< img src="website/images/image.jpg"
but when I open this site in browser, there are no any images on my page. What's the problem?

I guess the correct path would be
images/image.jpg
Because your file is already inside the website folder.

Related

With XAMPP how to set a default homepage

My problem is when I set up a server with XAMPP the homepage is the content of the image below:
I have a file named html.html and a folder named hello in which there is another html file. As document root in httpd.conf I have the default c:/xampp/htdocs. I do not want to change the root of the website just set up a html homepage to be opened when someone joins the website.
Create a file named index.html in htdocs. This will compiled as default homepage.

Codeigniter: Make uploads accessible

I'm using the upload class to allow users uploading file to the server.
Those files (e.g. profile images) should be accessible in the browser. Right now, the files stored under /application/uploads which of course cannot be accessed via browser.
Is there a way to make those uploaded files accessible via htaccess?
The only way I can think of, would be moving the files into the /public folder after being uploaded to /application/uploads
What's the best case to handle this?
your folder structure should be like :
---application
--- controllers
--- helpers
--- views
---asset
---system
---uploads
And Whenever you want to fetch/show image use
<img src="<?php echo base_url('uploads/'); ?>" >
Save the files in outside i.e. in public/uploads folder
Create .htaccess file in that folder
Add following line to .htaccess to secure the folder
Options -Indexes

keeping safe assets folder in codeigniter

Hi i have this assets folder which has the following folder inside of css, images, uploads, and js folder i put the assets folder outside application. Im wondering that how could i keep it safe so that when users tried to type in the url like for example http:/test.com/assets it will redirect to application folder or somewhat it will says page not found. Cause ive noticed that when i type in the url http://test.com/assets it will go to the assets folder and which is vulnerable and people could see all the folders in the assets folder. can someone help me figued this thing out? Any help is muchly appreciated.
if you want to secure you folder then do one this create html file like this
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
and save it as index.html and put it on your assets folder whenever some try to access your url http://test.com/assets then this index file will execute and its shows Directory access is forbidden.

How to change the default favicon for media URLs in Magento

I wants to show an image from media folder to frontend by accessing the link like
http://{siteurl}/media/image.jpg
here my problem is on the top of browser the tab it shows default magento favicon instead of my faviocon.
how can I show my faviocon in media URLs instead of the default faviocn.
any suggestion.
Hello you can change favicon icon from
System > Configuration > Design > HTML Head > Favicon Icon.

Image display codeigniter fails

I can upload image to the directory but can not disply it on the page.
Tried using static html code and codeigniter img() function, both are not working.
Here is my code:
<image src="./applications/views/uploads/image.jpeg" />
and
$this->output->set_header("Content-Type: image/jpeg");
$data['image'] = $this->load->file('../uploads/taurus.jpeg');
the first code shows me broken image the second one shows Unable to load the requested file: taurus.jpeg
<image src="./applications/views/uploads/image.jpeg" />
By default, CodeIgniter denies access to the application folder which is why I suspect this isn't working.
$this->output->set_header("Content-Type: image/jpeg");
$data['image'] = $this->load->file('../uploads/taurus.jpeg');
I suspect this isn't working because your path is incorrect. The path is relative to the index.php file in the root of your application, not the file this code is in. Secondly, $this->load->file() sends to file contents to the browser so this wouldn't work anyway.
A solution would be to move your uploads folder to a web accessible location. For example, place the uploads folder into the root of your application - the same folder as your index.php file. Then you can display your image like this:
<image src="/uploads/image.jpeg" />
Just get rid of the dot (.) in the URL so your src url reads: "/applications/views/uploads/image.jpeg"

Resources