views:

21

answers:

1

hi,

i'm trying to re-use and old website I made for an assignment, but I want to be able to keep the same format across the whole site.

this is the html/php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org    /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>askBU</title>
<meta name="Keywords" content="ask, BU, Bournemouth University" />
<meta name="Description" content="Welcome to askBU. Your One shop stop for student needs" />
<link href="css/css1.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="main">
<div id="header"></div>
<div id="menuMain">
                                                                                           </div>
<div id="contentWrapper">
    </div>
    <div id="content">
 <?php
 include("coursesearchresults.php");
 ?>
 </div>
<div id="footer">
</div>
</body>
</html>

this is the php file im trying to call:

<?php

// Connection Database
$search = $_POST ['Search'];

mysql_connect("xxxxx", "xxxxx", "xxxx") or die ("Error Connecting to Database");
mysql_select_db("xxxxxxx") or die('Error');
$data = mysql_query("SELECT * FROM course WHERE CourseName LIKE '%".$search."%'")
or die('Error');
print "<h2>Search Results:</h2>"

Print "<table border cellpadding=3>";
while($info = mysql_fetch_array( $data ))
 {
Print "<tr>";
Print "<th>Course Name:</th> <td>".$info['CourseName'] . "</td> ";
Print "<th>Course Description:</th><td>".$info['CourseDescription'] . "</td> ";
Print "<th>Course Leader:</th><td>".$info['CourseLeader'] . " </td></tr>";

}
Print "</table>";

?>

i want to use the same css but i need the table displayed in the webpage, but im getting an error on line 12. i'vr tried doing the above and i tried to just add the php code to my content div, but neither way is working, what am I doing wrong??

thanks

+1  A: 

It looks like the line just after your query is:

print "<h2>Search Results:</h2>"

Add a semicolon to the end of it and you should be OK.

JYelton
ha! thanks man! its still not using my css though, its like its completely ignoring it!
addi
Ok, check whether the CSS is being utilized. I do this using Firefox and the Web Developer add-on. You can view the loaded CSS definitions with a right-click (contextual menu), Web Developer -> CSS -> View CSS.
JYelton
when i add the php file into where I've got the include coursesearchresults.php, it shows it but doesnt conform to the css, i dont get it??
addi
as shown here: http://pastebin.com/NsH0aEJ6
addi
The link to the CSS is showing up of course, the question is, are the elements specified in the CSS loading properly? If there's an error in the CSS, it will invalidate the styles and effectively not do anything. If you try that addon, you can inspect the page to see exactly what CSS definitions have been loaded.
JYelton
@Jyelton, it seems to be using its own css!!
addi
Also, try commenting out the entire CSS file and just make one obvious style change like `body { color: green; }` to see if it works. If so, it is loading and you have a syntax error in the file somewhere. If that's the case, try asking about it separately or on doctype.com.
JYelton
this is the css: http://pastebin.com/m769SUKn
addi
I'm not an expert CSS reader :) I recommend commenting out the whole thing to try and determine if it's a loading or parsing problem. You could also try http://jigsaw.w3.org/css-validator/ if it is some sort of parsing problem. Web Developer will also show you CSS parsing problems, if they occur. https://addons.mozilla.org/en-US/firefox/addon/60/
JYelton
its ok! I had the wrong path to the css! thanks for all the help!
addi
Good luck and cheers. :)
JYelton