Jump to content

stylesheet not working


clankill3r

Recommended Posts

Hi,

 

Can someone why my stylesheet is not working?

<?php

header('Content-type: text/html; charset=utf-8');

include 'config.php';
include 'lib.php';

$db = dbConnect();

if (isset($_GET['ip']))
{
$ip = $_GET['ip'];
$longitude = $_GET['long'];
$latitude = $_GET['lat'];

$searches = getSearchesByIP($ip);
$watchUser = true;

}
else
{
$searches = getSearches();
$watchUser = false;
}

dbClose($db);


?>

<html>
<head>
<title>cms</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="inc/css/style.css" />
</head>
<body>

<h1>WTF</h1>

<div id="container">

<? 
    if ($watchUser == true)
{?>
	<a href=searches.php> See all</a>

	<br/>

	<table>
		<tr>
			<th>ip</th>
			<td><?=$ip;?></td>
		</tr>
		<tr>
			<th>longitude</th>
			<td><?=$longitude;?></td>
		</tr>
		<tr>
			<th>latitude</th>
			<td><?=$latitude;?></td>
		</tr>

	</table>
<?
}
    ?>

<br/>
    
    <table>
    	<tr>
    	    <th>id</th>
    	    <? if ($watchUser == false) echo "<th>ip</th>"; ?>
    	    <th>question</th>
    	    <? if ($watchUser == false) echo "<th>longitude</th>"; ?>
    	    <? if ($watchUser == false) echo "<th>latitude</th>"; ?>
        </tr>
        <?
	foreach($searches as $search) {
		?>
            <tr>
  	            <td><?=$search['id'];?></td>
  	            
  	            <? if ($watchUser == false)
  	            {
  	            echo "<td> <a href='searches.php?ip=" . $search['userIP'] . "&long=" . $search['longitude'] . "&lat=" . $search['latitude'] . "'>" . $search['userIP'] . "</ a> </td>";
  	         	}
  	            ?> 
  	            
    	        <td><?=$search['question'];?></td>	
        	    <? if ($watchUser == false) echo "<td>" . $search['longitude'] . "</td>"; ?>	
        	    <? if ($watchUser == false) echo "<td>" . $search['latitude'] . "</td>"; ?>
     		    <td><a href="answers.php?id=<?=$search['id'];?>">see answers</a></td>
                <td><a href="inc/php/utils/search-delete.php?id=<?=$search['id'];?>">delete</a></td>
            </tr>
            <?
	}
	?>

    </table>

</div>
    <a href="search.php">Add new</a>

</body>
</html>

 

my css file:

 

a:link {color:#FF0000;}    /* unvisited link */

a:visited {color:#00FF00;} /* visited link */

a:hover {color:#FF00FF;}  /* mouse over link */

a:active {color:#0000FF;}  /* selected link */

 

/*

table

{

font-family: "Arial";

font-size: 10px;

color:red;

}

*/

 

 

table, th, td

{

border:1px solid black;

}

 

h1 {color:#00ff00;}

 

 

Link to comment
https://forums.phpfreaks.com/topic/231186-stylesheet-not-working/
Share on other sites

My guess would be that it's a path issue. try adding a / slash before the path in the href= attribute. You need to have a <!DOCTYPE declaration in the markup also . . .

 

<link rel="stylesheet" type="text/css" href="/inc/css/style.css" />

Thanks, i got it working.

 

Only 1 problem now.

 

If i make changes and look at the uploaded css file then nothing changes in that.

If i delete the file i can even visit the link with the css.

If i look in the directory it's gone.

 

I uploaded the file again, but still it shows with the old code.

 

i can bypass it by adding a number to the filename. like style01.css, make a change save as style02.css but this is really shit and slow to do.

 

I got this problem in safari, firefox and chrome.

The last time I remember seeing a similar problem, I *think* it was resolved by using a standalone FTP client to upload the files rather than the built-in FTP client in the user's editor. I don't remember for certain if that solved it, but it's worth a shot.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.