Hey everyone. I've read this site for a while and it is great, but I haven't committed myself enough to classify myself as better than a "newbie."
Anyway, I have a strange problem with one of my codes (view it at http://www.pwndaily.com/portfolio/index.php)
The problem is: when I add a "/" to the end of the index.php url, my stylesheets no longer work. This invalidates my code because I use $REQUEST_URI to figure out exactly which page the user is looking for.
This is just a skeletal outline. I am not certain that this is a PHP problem, but I figured there must be many experienced, helpful people here that (in the case that my PHP is okay and it's something else) could offer me suggestions.
Thanks!
<?php
ob_start();
//include("../includetop.inc");
//detect cookie
$location = explode("/",$_SERVER['PHP_SELF']);
$specific = $location[3];
if($specific == "feed")
{
header('Content-Type: text/xml');
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";
echo "<rss version=\"2.0\">";
}
else{
if($specific == "")
{
$content = "Here's the index!";
}
else
{
$sql = "SELECT content FROM portfolio WHERE section = '$specific'";
$data = mysql_query($sql);
if(!$data)
{
$content = "It seems you have come to a dead end! If you think this is an error, please drop me a line and let me know. If not, click back on track!";
}
else
{
$array = mysql_fetch_array($data);
$content = $array[0];
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="portfolio_style_snowflake.css" rel="stylesheet" type="text/css">
<link href="portfolio_style_fontsize_normal.css" rel="stylesheet" type="text/css">
</head>
<body>
<table border="0" align="center">
<tr>
<td width="60"> </td>
<td><table align="left" id="header">
<tr>
<td><div id="title">Welcome </div>
<div id="description"> to the portfolio of Henry Hund. I appreciate your consideration and look forward to working with you. </div></td>
</tr>
</table></td>
<td width="60"> </td>
</tr>
<tr>
<td width="60"> </td>
<td align="left"><table align="left" id="header">
<tr>
<td id="header_links" width="20%"><a href="index.php/classes">Classes</a></td>
<td id="header_links" width="20%"><a href="index.php/involvement">Involvement</a></td>
<td id="header_links" width="20%"><a href="index.php/experience">Experience</a></td>
<td id="header_links" width="20%"><a href="index.php/aboutme">About Me</a> </td>
<td id="header_links" width="20%"><a href="index.php/resume">RÉsumÉ</a></td>
</tr>
</table></td>
<td width="60"> </td>
</tr>
<tr>
<td width="60"> </td>
<td> <table align="left" id="side-bar">
<tr>
<td><p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table>
<table align="left" id="content">
<tr>
<td><?php echo $specific.$content; ?>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table></td>
<td width="60"> </td>
</tr>
<tr>
<td width="60"> </td>
<td><table align="left" id="header">
<tr>
<td id="copyright">test</td>
</tr>
</table></td>
<td width="60"> </td>
</tr>
</table>
</body>
</html>
<?php
}
?>