Yeah try using echo instead of print and see what you get.
Main Topics
Browse All TopicsHi!
It's kinda weird problem: my php statement doesn't like a question mark. It took me a while to pinpoint the problem, but finally I found out that it is a... question mark! When I have a slash before a question mark, CSS formatting works fine, when I remove it, CSS is not responding.
Maybe it doesn't make sense what I'm trying to explain, so I hope my php code explains that better:
<?php
//this is part of the code, which grabs the data from mySQL, and prints it out.
$news = $word_data['NEWS_ID'];
$title = $word_data['TITLE'];
print '<table><tr><td class="title">';
print '<A HREF="' . $webpath . 'display.php?textid=' . $news . '">' . $title . '</A><BR>';
print '<A HREF="' . $webpath . 'display.php/?textid=' . $news . '">' . $title . '</A></td></tr></table>';
?>
// This is CSS file, which works fine (changes when hover), only with the second A HREF statement. Without a slash it doesn't work!
.title {
font-weight: bold;
font-size: 12px;
font-style: normal;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #000033;
text-indent: 0px;
text-decoration: none;
}
.title a:link {
color: #000033;
text-decoration: none;
}
.title a:hover {
color: #0000CD;
text-decoration: underline;
}
.title a:visited {
color: #00008B;
text-decoration: none;
}
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: D4LyPosted on 2005-11-24 at 15:36:30ID: 15358464
Hi athanasius296-
l1/DTD/xht ml1-transi tional.dtd "> 999/xhtml" >
putting this together into one file (which can easily be broken up again), I've replaced:
$news = $word_data['NEWS_ID'];
$title = $word_data['TITLE'];
with
$news = "news";
$title = "something";
just for testing (since i don't know what these values are in your context)...the final code i have is below, which works perfectly WITHOUT a slash / in both FF and IE6.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtm
<html xmlns="http://www.w3.org/1
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.title {
font-weight: bold;
font-size: 12px;
font-style: normal;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #000033;
text-indent: 0px;
text-decoration: none;
}
.title a:link {
color: #000033;
text-decoration: none;
}
.title a:hover {
color: #0000CD;
text-decoration: underline;
}
.title a:visited {
color: #00008B;
text-decoration: none;
}
-->
</style>
</head>
<body>
<?php
//this is part of the code, which grabs the data from mySQL, and prints it out.
//$news = $word_data['NEWS_ID'];
//$title = $word_data['TITLE'];
$news = "news";
$title = "something";
echo '<table><tr><td class="title">';
echo '<a HREF="' . $webpath . 'display.php?textid=' . $news . '">' . $title . '</a><br />';
echo '<a HREF="' . $webpath . 'display.php?textid=' . $news . '">' . $title . '</a></td></tr></table>';
?>
</body>
</html>
hope this helps.