HELP! Undefined index: title...
Posted: Mon Sep 15, 2008 12:56 am
Can someone please tell me what is wrong with my code? I am getting the following error: "Notice: Undefined index: title in c:\program files\easyphp1-8\www\lifesannouncements\ccpageview.php on line 83". Following are snippets of the file named 'ccpageview.php' (full code follows at end):
. . .
Thank you!
Full 'ccpageview.php' code:
Code: Select all
$title = mysql_fetch_array($page_title);
$title = $title[0];
echo $title;Code: Select all
<?php
$title = $_GET['title'];
$intro_title = "SELECT title FROM introtext WHERE page='$title'";
$intro_title = mysql_query($intro_title);
$title_text = mysql_fetch_array($intro_title);
$title_text = $title_text[0];
echo $title_text;
?>Full 'ccpageview.php' code:
Code: Select all
<?php
include("includes/defs.php");
include("includes/db_connect.php");
?>
<?php
include("includes/docheader.php");
?>
<HTML>
<HEAD>
<TITLE><dynamic from DB></TITLE>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<meta name="keywords" content="<?php
$paget = $_GET['paget'];
$page_title = "SELECT keywords FROM metatags WHERE page='$paget'";
$page_title = mysql_query($page_title);
$title = mysql_fetch_array($page_title);
$title = $title[0];
echo $title;
?>">
<meta name="description" content="<?php
$pagekws = $_GET['pagekws'];
$page_keywords = "SELECT title FROM metatags WHERE page='$pagekws'";
$page_keywords = mysql_query($page_keywords);
$keywords = mysql_fetch_array($page_keywords);
$keywords = $keywords[0];
echo $keywords;
?>">
<!--ANY OTHER META TAGS WE SHOULD INCLUDE???-->
<?php include("includes/style.inc"); ?>
</HEAD>
<BODY>
<!--<?php
function page_intro_text() {
$page = $_GET['page'];
$intro_text = "SELECT intro_text FROM introtext WHERE page='$page'";
$intro_text = mysql_query($intro_text);
$text = mysql_fetch_array($intro_text);
$text = $text[0];
echo $text;
}
?>-->
<?php
include("includes/header.inc");
?>
<CENTER>
<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="5">
<TR>
<TD VALIGN="top">
<?php
include("includes/left_links.inc");
?>
<BR>
<?php
include("includes/resources_info.inc");
?>
<BR>
<?php
include("includes/help_links.inc");
?>
</TD>
<TD>
</TD>
<TD width="100%" ALIGN="center" VALIGN="top">
<BR>
<P align="center"><b>
<?php
$title = $_GET['title'];
$intro_title = "SELECT title FROM introtext WHERE page='$title'";
$intro_title = mysql_query($intro_title);
$title_text = mysql_fetch_array($intro_title);
$title_text = $title_text[0];
echo $title_text;
?></b>
<P align="left">
<?php
$page = $_GET['page'];
$intro_text = "SELECT intro_text FROM introtext WHERE page='$page'";
$intro_text = mysql_query($intro_text);
$text = mysql_fetch_array($intro_text);
$text = $text[0];
echo $text;
?>
<br>
<br>
<a href="http://localhost/lifesannouncements/noframes.php" frame="right"><blockquote><small>If you are using a browser that does not support frames or if you wish to view the preview product root of the information below in a seperate window, CLICK on this link.</small></blockquote></a>
<!--<?php
page_intro_text();
?>-->
</P>
<?php
// syntax for linking to iframe:
// http://localhost/lifesannouncements/ccp ... localhost/
if(isset($_GET['cc_link'])){
$cc_link = $_GET['cc_link'];
}else{
$cc_link = "about:blank";
}
?>
<IFRAME src="<?php echo $cc_link ?>" frameborder="0" width="100%" height="1000"><center><b>NOTICE:</b></center>
You have entered a section of Life's Announcements (providers of world class birth announcements, wedding invitations and graduation announcements) web site that requires frames to view properly (it appears that the web-browser you are currently using does not support frames). This is no problem, however, as we have provided to you, our valued customer, special pages that will allow you to view the information you have requested, order any items from these pages you choose and then re-enter the normal view of our web-site after you are done with these pages. There are a few things you should be aware of as you view this portion of our web site <b>(PLEASE READ THE FOLLOWING INFORMATION CAREFULLY)</b>:
<OL>
<LI>You will have to click on the “CLICK HER TO CONTINUE” link below in order to get started and view the information you requested.</LI>
<LI>The next page will have some general information on it concerning the product category you initially selected. Read this for some valuable information. When you are ready to view the product line and products you are interested in, click on the sample product image or text below it to proceed; this will open a new web-browser window with product information and links to specific products contained therein.</LI>
<LI>At this point you will be able to view products, read their descriptions and order any product(s) you desire. When finished with your shopping needs, you can close the new web-browser window and return to our main web site.</LI>
</OL>
Thank you very much for your cooperation. We are sorry for any inconvenience this may cause. This is no fault of ours, it’s just how the Internet works - we have made it as simple for you as possible.
<br>
<br>
<a href="http://localhost/lifesannouncements/noframes.php" frame="right">CLICK HERE TO CONTINUE</a>
</IFRAME>
</TD>
<!--<TD VALIGN="top">
<?php
include("includes/login_box.inc");
?>
</TD>-->
</TR>
</TABLE>
</CENTER>
<TABLE cellpadding="30">
<TR>
<TD>
<?php include("includes/bottom_info.php"); ?>
</TD>
</TR>
</TABLE>
<?php include ("includes/footer.inc"); ?>