Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are my images not found on my web server?

Tags:

html

css

php

image

I have a weird issue on my site. When I want to access the images in folders they don't show up. I've tried everything but I don't understand.

My CSS is also not working because my text is not changing. It's only working when I go to the main page.

I have 2 pages, for example, /contact/ and /about/. These don't work.

Here is the full listing of my folder.

/ui/images/logo.jpg (etc...)
/ui/css/site.css
/javas/site.js
/index.php

here my script (i removed some useless stuff)

<?php
$page = $_GET['page'];

$conn = mysql_connect("localhost", "user", "password");
mysql_select_db("page");

$sql = "SELECT * FROM page WHERE page = '".$page."'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
mysql_free_result($result);

?>
<html>
<body>
<script type="text/javascript" src="javas/site.js"></script>
<link rel="stylesheet" type="text/css" href="ui/css/site.css">
<?php echo $row['page']; ?>
</body>
</body>

What can I do to fix it?

like image 719
Adam Avatar asked Dec 04 '11 00:12

Adam


1 Answers

Try using full path like:

http://your_host/your_project/javas/site.js

Hope it helps

like image 116
Sudhir Bastakoti Avatar answered Oct 06 '22 22:10

Sudhir Bastakoti