Hello. My name is Raymond.
My code is generating the following error: Notice: Undefined offset: 2 in C:\wamp\www\ima gegallery\suppo rtfile\include\ config.php on line 25
How do i correct the error?
Here is the code:
My code is generating the following error: Notice: Undefined offset: 2 in C:\wamp\www\ima gegallery\suppo rtfile\include\ config.php on line 25
How do i correct the error?
Here is the code:
Code:
<?php
// Include file for database connectivity
$db_server = "localhost";
$db_user = "root";
$db_pass = "";
$db_name = "images";
DEFINE("IMAGE_DISPLAY", 3);
DEFINE("IMAGE_LOC", '../photos/');
DEFINE("THUMB_LOC", '../thumbs/');
function db_connect(){
global $db_server;
global $db_user;
global $db_pass;
global $db_name;
$dbcnx = mysql_connect($db_server, $db_user, $db_pass) or die("Error connecting to database: " . mysql_error());
$dbsel = mysql_select_db($db_name, $dbcnx) or die("Error reading from database table: " . mysql_error());
}
function format_date($date){
list($yyyy, $mm, $dd) = explode("-", $date);
$day[] = explode(' ', $dd);
$date = date('F jS, Y', time(0,0,0,$mm,$day[0],$yyyy));
//echo("<br><br>Now: " . $date);
return $date;
}
function displayPage($msg = "", $title="", $cell = true){
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php echo($title); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="60%" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td width="40%" valign="top"><h1><?php echo($title); ?></h1></td>
</tr>
</table>
<table width="60%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<?php
// Display opening <td> tag
if ($cell)
echo("<td>");
echo($msg);
// Display closing <td> tag
if ($cell)
echo("</td>");
?>
</tr>
</table>
<table width="60%" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td><a href="http://bytes.com/submit/admin/index.php">Main Menu</a> | <a href="http://bytes.com/submit/admin/new_album.php">Create
New Album</a> | <a href="http://bytes.com/submit/gallery.php">View Gallery</a></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
<?php
}
?>
Comment