Hey, I'm new to PHP. I purchased a site that has a number of PHP pages that my users access frequently. I'm ready to relaunch the site but I can't get the PHP pages to work with the new ISP and my programming.
Here's the old page (that works):
http://www.trisite.com/messageBoard.php
And here's the page I tried to creat (which doesn't work)
http://www.trisite.com/messageBoard1.php
I keep getting this:
Fatal error: Failed opening required '../../Old%20Site%20Pages/www/functions/db_mysql.inc' (include_path='.:/usr/local/lib/php') in /home/trisite/www/messageBoard1.php on line 28
What the samhill is going on?
The longer I have this problem the longer I have to wait to relaunch.
Below is the botched up code.
Thanks,
Utahclimber
Botched up code:
<html>
<head>
<!-- #BeginEditable "doctitle" -->
<title>Message Board - Trisite.com</title>
<!-- #EndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#3366FF" vlink="#3366FF" alink="#FF9900">
<p align="center"><font color="#FF6600" size="6" face="Arial, Helvetica, sans-serif"><strong>message
board </strong></font></p>
<p><font face="Arial, Helvetica, sans-serif"><strong>Welcome to TriSite.com's
message board</strong></font></p>
<p><font face="Arial, Helvetica, sans-serif"><strong>TriSite.com's </strong>vision
is to create the world's largest and most comprehensive website of triathlon,
duathlon, swimming, cycling, and running related information. If it has to do
with multi-sports, swimming, cycling or running, it's here! Whether you're looking
for your latest race results or for a new coach in your area, you'll find them
here.</font></p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td width="135" valign="top" align="left"> </td>
<td width="100%"> <center>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><!-- #BeginEditable "Main%20Screen" -->
<?
//functions and dbconnection files
require("../../Old%20Site%20Pages/www/functions/db_mysql.inc"); // DB_Sql database class
require("../../Old%20Site%20Pages/www/functions/local.inc"); // DB_Local extended DB_Sql class
require("../../Old%20Site%20Pages/www/functions/functions.inc");
//static variables
define(DISPLAY,0);
define(INPUT,1);
define(TOPIC,2);
//determine if action is defined
if(empty($action)){
$action = DISPLAY;
}
if(empty($offset)){
$offset=0;
}
$db = new DB_Local;
$query = "SELECT mess_board_key from mess_board where parent_key = 0";
$db->query($query);
$messcount = $db->num_rows();
$mprev = $offset-15;
$mnext = $offset+15;
$from = $offset+1;
$to = $from+14;
//what action should the scipt perform
switch($action){
case DISPLAY: //displays the messages
if (!isset($mess_board_key)){
$mess_board_key = 0;
}
if($mess_board_key==0){
//print out header information
print("<TABLE WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=0 BORDER=0>\n");
print(" <TR>\n");
print(" <TD HEIGHT=21 bgcolor=\"#FFFFFF\" colspan=2 align=\"left\">\n");
print(" <font size=2><a href=\"messageBoard.php\">Topic List</a></font> |\n");
print(" <font size=2><a href=\"messageBoard.php?action=2\">New Topic</a></font>\n");
print(" </TD>\n");
print(" <TD HEIGHT=21 bgcolor=\"#FFFFFF\" align=\"right\">\n");
if($mprev>=0){
print(" <font size=2><img src=\"images/l-triangle.gif\"><a href=\"messageBoard.php?offset=$mprev\">Prev </a></font>\n");
}
print(" <font size=1>($from - $to) of $messcount</font>\n");
if($messcount >= $mnext){
print(" <font size=2><a href=\"messageBoard.php?offset=$mnext\"> Next</a><img src=\"images/r-triangle.gif\"></font>\n");
}
print(" </TD>\n");
print(" </TR>\n");
print(" <TR>\n");
print(" <TD HEIGHT=21 bgcolor=\"#003399\"><FONT COLOR=\"#FFFFFF\"> Topics</FONT></TD>\n");
print(" <TD HEIGHT=21 bgcolor=\"#003399\" NOWRAP WIDTH=150><FONT COLOR=\"#FFFFFF\">Author </FONT></TD>\n");
print(" <TD HEIGHT=21 bgcolor=\"#003399\" NOWRAP WIDTH=100 align=\"center\"><FONT COLOR=\"#FFFFFF\">Date</FONT></TD>\n");
print(" </TR>\n");
//display all messages
ShowAllMessages($mess_board_key,0,0,0,$offset);
print("</TABLE>\n");
print("<br><br>");
}else{
DisplayMessage($mess_board_key);
}
break;
case INPUT:
//allows the user to create a message
$mess_board_key = CreateTopic ($name, $author, $description, $parent_key, $root_key);
print("<TABLE WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=0 BORDER=0>\n");
print(" <TD HEIGHT=21 bgcolor=\"#FFFFFF\" colspan=3 align=\"left\">\n");
print(" <font size=2><a href=\"messageBoard.php\">Topic List</a></font> |\n");
print(" <font size=2><a href=\"messageBoard.php?action=2\">New Topic</a></font>\n");
print(" </TD>\n");
print(" </TR>\n");
print("<TR>\n");
print(" <TD HEIGHT=21 bgcolor=\"#003399\"><FONT COLOR=\"#FFFFFF\"> Topics</FONT></TD>\n");
print(" <TD HEIGHT=21 bgcolor=\"#003399\" NOWRAP WIDTH=150><FONT COLOR=\"#FFFFFF\">Author </FONT></TD>\n");
print(" <TD HEIGHT=21 bgcolor=\"#003399\" NOWRAP WIDTH=100 align=\"center\"><FONT COLOR=\"#FFFFFF\">Date</FONT></TD>\n");
print("</TR>\n");
ShowAllMessages(0);
print("</TABLE>\n");
print("<br><br>");
break;
case TOPIC:
print("<TABLE WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=0 BORDER=0>\n");
print(" <TD HEIGHT=21 bgcolor=\"#FFFFFF\" colspan=3 align=\"left\">\n");
print(" <font size=2><a href=\"messageBoard.php\">Topic List</a></font> |\n");
print(" <font size=2><a href=\"messageBoard.php?action=2\">New Topic</a></font>\n");
print(" </TD>\n");
print(" </TR>\n");
print("<TR>\n");
print(" <TD HEIGHT=21 bgcolor=\"#003399\" colspan=3><FONT COLOR=\"#FFFFFF\">New Topic</FONT></TD>\n");
print("</TR>\n");
print("</TABLE>\n");
DisplayForm($mess_board_key,$root_key,$name);
break;
}
?>
<!-- #EndEditable --></td>
</tr>
</table>
<br>
</center></td>
</tr>
</table>
</body><!-- #EndTemplate -->
</html>