skoobi Posted March 22, 2010 Share Posted March 22, 2010 Hi im getting this error whith the login script ive implemented and cannot figure it out at all... Notice: Undefined variable: message in \admin\enquiry\index.php on line 189 this is the index file: <!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"><head> <script type="text/javascript" language="JavaScript" src="index.php_files/chipsaway.js"></script> <!-- REMOVE <script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <script src="../SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script>--> <script src="scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="scripts/jquery/plugins/validate/jquery.validate.min.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="styles/dropdown.css"> <link rel="stylesheet" type="text/css" href="../../styles/guarantee-css.css"> <style type="text/css"> <!-- .red { color: #F00; } .small { font-size: small; color: #F00; } #address-container { width: 100%; } #address-container ul { list-style: none; margin: 0; padding: 0; border: none; } #address-container li:hover { color:#339999; } #loader-img{ display:none; } label.error{ color: #F00; display:block; clear: both; } --> </style> <script type="text/JavaScript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } //--> $ = jQuery.noConflict(); /** * Jquery set up for using the address finder */ $(document).ready(function() { /** * Find address */ var showing_address = false; $('#loader-img').ajaxStart(function(){ $(this).toggle(); }); $('#loader-img').ajaxComplete(function(){ $(this).toggle(); }); get_callback = function(data){ $('#address-container').html(data); $('#address-container').slideDown(); showing_address = true; $('#address-container ul li').each(function(){ $(this).click(function(){ $('#address').val($(this).html()); $('#address-container').slideUp(); showing_address = false; }); }); } $('#findadress_btn').click(function(event){ event.preventDefault(); $.get("findaddress.php", { PostCode: $('#PostCode').val()}, get_callback); }); $('#address').focus(function(){ if(showing_address){ $('#address-container').slideUp(); } }); $('#PostCode').keydown(function (event) { if (event.keyCode == 13) { event.preventDefault(); $.get("findaddress.php", { PostCode: $('#PostCode').val()}, get_callback); } }); /** * Validation */ $("#form2").validate({ rules: { name: { required: false }, email: { required: false, email: false }, phone: { required: false, digits: true }, address: { required: false } }, messages: { name: "Please enter your full name.", email: "Please make sure your email address is correct.", phone: {required: "Please enter your full number with dialling code.", digits: "Please only include numbers and remove any spaces." }, address: { required: "Please enter your full address or search above with your post code" } } }); });// end of ready check </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Chipsaway - Admin Franchise Finder</title> </head> <LINK REL="stylesheet" TYPE="text/css" HREF="styles/guarantee-css.css"> </HEAD> <BODY BGCOLOR="#339A99" MARGINWIDTH="0" MARGINHEIGHT="0" TOPMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0"> <DIV ALIGN="center" CLASS="standard"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="1" HEIGHT="7"><BR> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="881" HEIGHT="31"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="31" HEIGHT="31"> <IMG SRC="images/chipsaway005.gif" WIDTH="31" HEIGHT="31" BORDER="0" ALT=""></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="819" HEIGHT="31" BACKGROUND="images/chipsaway003.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="1" HEIGHT="31"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="31" HEIGHT="31"> <IMG SRC="images/chipsaway006.gif" WIDTH="31" HEIGHT="31" BORDER="0" ALT=""></TD> </TR> </TABLE> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="881"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="17" HEIGHT="152" BACKGROUND="images/chipsaway001.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="17" HEIGHT="1"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="847" HEIGHT="152" BGCOLOR="#ffffff" COLSPAN="<? if ($navNum>0) { if ($PAGEuseAlternativeLayout=='on') { echo "9"; } else { echo "7"; } } else { if ($PAGEuseAlternativeLayout=='on') { echo "5"; } else { echo "3"; } } ?>" BACKGROUND="images/chipsaway011.gif"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="847" HEIGHT="152"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="716"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="716"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="201"> <A HREF="index.php"> <IMG SRC="images/logo.gif" WIDTH="149" HEIGHT="86" BORDER="0" ALT="Chips Away" HSPACE="26" VSPACE="3"></A><BR> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="1" HEIGHT="9"><BR> </TD> <TD ALIGN="center" VALIGN="top" CLASS="standard" WIDTH="215"><BR> </TD> <TD ALIGN="right" VALIGN="top" CLASS="standard" WIDTH="300"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="1" HEIGHT="21"><BR></TD> </TR> </TABLE></TD> <TD ALIGN="left" VALIGN="bottom" CLASS="standard" WIDTH="131"> </TD> </TR> </TABLE> </TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="17" HEIGHT="152" BACKGROUND="images/chipsaway002.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="17" HEIGHT="1"></TD> </TR> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="17" BACKGROUND="images/chipsaway001.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="17" HEIGHT="1"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="847" BGCOLOR="#ffffff" STYLE="background-image: url(images/chipsaway019.gif); background-repeat: repeat-y; background-position:top left; font-size: 12px; font-family: Arial;" COLSPAN="<? if ($navNum>0) { if ($PAGEuseAlternativeLayout=='on') { echo "9"; } else { echo "7"; } } else { if ($PAGEuseAlternativeLayout=='on') { echo "5"; } else { echo "3"; } } ?>"> <!--GUARANTEE FORM--> <!--GUARANTEE FORM END--> <IMG SRC="images/spacer.gif" WIDTH="1" HEIGHT="22" BORDER="0" ALT=""> <?php require_once('../../Connections/conContact.php'); ?> <div id="section2"> <div class="content"> <div class="entry" > <form id="form1" name="form1" method="post" action="login.php"> <table align="center"> <tr> <td colspan="2" class="body"><span class="warning"><? echo $message; ?></span></td> </tr> <tr> <td class="body">User :</td> <td class="body"><input name="username" type="text" id="username" /></td> </tr> <tr> <td class="body">Password : </td> <td class="body"><input name="password" type="password" id="password" /></td> </tr> <tr> <td class="body"> </td> <td align="right" class="body"><input name="Login" type="submit" id="Login" value="Login" /></td> </tr> </table> <span class="body"><br/> </span> </form> <p> </p> </div> </div> </div> </p> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="847"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="330"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BORDER="0"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="<? echo $TEMPLATEbuttonMargin; ?>"> <IMG SRC="<? echo $WEBSITEinternalPath; ?>lumo/images/spacer.gif" WIDTH="1" HEIGHT="<? echo $TEMPLATEbuttonImageHeader; ?>" BORDER="0" ALT=""><BR> </TD> <TD ALIGN="left" VALIGN="top" CLASS="standard"> <IMG SRC="<? echo $WEBSITEinternalPath; ?>lumo/images/spacer.gif" WIDTH="1" HEIGHT="<? echo $TEMPLATEbuttonTextHeader; ?>" BORDER="0" ALT=""><BR> </TD> </TR> </TABLE> </TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="26"> <IMG SRC="images/spacer.gif" WIDTH="26" HEIGHT="1" BORDER="0" ALT=""></TD> </TR> </TABLE> </TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="17" BACKGROUND="images/chipsaway002.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="17" HEIGHT="1"></TD> </TR> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="17" BACKGROUND="images/chipsaway001.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="17" HEIGHT="1"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="26" BGCOLOR="#ffffff"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="26" HEIGHT="1"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="132" BGCOLOR="#ffffff"></TD> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="881" HEIGHT="31"> <TR> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="31" HEIGHT="31"> <IMG SRC="images/chipsaway007.gif" WIDTH="31" HEIGHT="31" BORDER="0" ALT=""></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="819" HEIGHT="31" BACKGROUND="images/chipsaway004.gif"> <IMG SRC="images/spacer.gif" BORDER="0" ALT="" WIDTH="1" HEIGHT="31"></TD> <TD ALIGN="left" VALIGN="top" CLASS="standard" WIDTH="31" HEIGHT="31"> <IMG SRC="images/chipsaway008.gif" WIDTH="31" HEIGHT="31" BORDER="0" ALT=""></TD> </TR> </TABLE> </BODY> </html> This is the line in question is a <tr> tag... Any help would be greatfull im going bold... Cheers Chris Quote Link to comment Share on other sites More sharing options...
Adam Posted March 22, 2010 Share Posted March 22, 2010 You're trying to use variables that haven't been declared. My guess is this line: <? echo $message; ?> Where have you declared $message? Quote Link to comment Share on other sites More sharing options...
strangesoul Posted March 22, 2010 Share Posted March 22, 2010 Yeah its true, To correct the error you can initially assign empty value to that variable. <?php $message=''; ..... ?> Quote Link to comment Share on other sites More sharing options...
Adam Posted March 22, 2010 Share Posted March 22, 2010 Better to look into the empty and isset functions. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.