clankill3r Posted March 20, 2011 Share Posted March 20, 2011 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 More sharing options...
Pikachu2000 Posted March 20, 2011 Share Posted March 20, 2011 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" /> Link to comment https://forums.phpfreaks.com/topic/231186-stylesheet-not-working/#findComment-1189940 Share on other sites More sharing options...
clankill3r Posted March 20, 2011 Author Share Posted March 20, 2011 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. Link to comment https://forums.phpfreaks.com/topic/231186-stylesheet-not-working/#findComment-1189970 Share on other sites More sharing options...
Pikachu2000 Posted March 20, 2011 Share Posted March 20, 2011 Have you tried clearing your browser cache after making changes to the file? How are you uploading it, via an FTP client? Link to comment https://forums.phpfreaks.com/topic/231186-stylesheet-not-working/#findComment-1189972 Share on other sites More sharing options...
clankill3r Posted March 20, 2011 Author Share Posted March 20, 2011 clearing cache doesnt work (tried ffox and chrome). And i use coda which has some ftp thing in it. If i look in the directory then the time of the last upload gets updated. Link to comment https://forums.phpfreaks.com/topic/231186-stylesheet-not-working/#findComment-1189979 Share on other sites More sharing options...
Pikachu2000 Posted March 20, 2011 Share Posted March 20, 2011 I've never used coda. Can you delete the target file before uploading the new copy and see if the behavior is the same? Link to comment https://forums.phpfreaks.com/topic/231186-stylesheet-not-working/#findComment-1189985 Share on other sites More sharing options...
clankill3r Posted March 20, 2011 Author Share Posted March 20, 2011 i tried, it doesnt matter Link to comment https://forums.phpfreaks.com/topic/231186-stylesheet-not-working/#findComment-1189987 Share on other sites More sharing options...
Pikachu2000 Posted March 20, 2011 Share Posted March 20, 2011 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. Link to comment https://forums.phpfreaks.com/topic/231186-stylesheet-not-working/#findComment-1189990 Share on other sites More sharing options...
clankill3r Posted March 20, 2011 Author Share Posted March 20, 2011 tried, it doesnt help. The css get's updated sometime, like after 1 hour or something. Link to comment https://forums.phpfreaks.com/topic/231186-stylesheet-not-working/#findComment-1190026 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.