Reputation: 31
Style sheet not linking to PHP page. Have tried everything from adding the meta tags you'll see below, checking file location, but nothing seems to solve the problem.
Here is the profile.php file:
<?php
include("includes/header.php");
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8"></meta>
<title>My title</title>
<link href="css/style.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<?php
if(isset($_GET['profile_username'])){
$username = $_GET['profile_username'];
$user_details_query = mysqli_query($conn, "SELECT * FROM users WHERE username='$username'");
$user_array = mysqli_fetch_array($user_details_query);
$num_friends = (substr_count($user_array['friend_array'], ",")) - 1;
}
?>
<div class="profile_left">
<img src="<?php echo $user_array['profile_pic']; ?>">
</div>
<div class="profile_info">
<p><?php echo "Posts: " . $user_array['num_posts']; ?></p>
<p><?php echo "Likes: " . $user_array['num_likes']; ?></p>
<p><?php echo "Friends: " . $num_friends ?></p>
<div class="main_column column">
<?php echo $username; ?> This is a profile page.
</div>
</div> <!-- closes wrapper from header.php-->
</body>
</html>
style.css class that should apply:
.profile_left {
top: -10px;
width: 17%;
max-width: 240px;
min-width: 130px;
height: 100%;
float: left;
position: relative;
background-color: #37b0e9;
border-right: 10px solid #83d6fe;
color: #cbeaf8;
margin-right: 20px;
}
File Hierarchy is below:
Upvotes: 0
Views: 453
Reputation: 1582
Try the below code
<link href="/css/style.css" media="screen" rel="stylesheet" type="text/css" />
Upvotes: 1