
Paul-D
Members-
Posts
148 -
Joined
-
Last visited
Paul-D's Achievements

Advanced Member (4/5)
0
Reputation
-
Sorry but the last post was wrong. I am still getting the werror message on the page. Can someone see where I am loosing a SESSION variable that was established in function Session_Init() inSecureFunctions.php at the start of the page code? http://desmond-otoole.co.uk/SessionVariable.jpg
-
Seems that my host server has been cashing on me again. after a forced update ctrl+F5 it is now sorted. Thanks.
-
The nightmare continues. I am getting an Undefined array key "DE_Retain" in /vhost/d/e/s/desmond-otoole.co.uk/www/bank2/DataInput.php on line 218 I have pre set this session in SecureFunctions.php Line 276 in function Session_Init() http://desmond-otoole.co.uk/SessionVariable.jpg SecureFunctions.php (part) function Session_Init() { if (!isset($_GET['counter'])) $_GET['counter'] = ""; if (!isset($_SESSION['current_page'])) $_SESSION['current_page'] = ''; if (!isset($_SESSION['Event_Log'])) $_SESSION['Event_Log'] = ''; if (!isset($_SESSION['K9'])) $_SESSION['K9'] = ''; if (!isset($_SESSION['Survalance'])) $_SESSION['Survalance'] = ''; if (!isset($_SESSION["K208"])) $_SESSION["K208"] = ''; if (!isset($_SESSION["Error_1"])) $_SESSION["Error_1"] = ''; if (!isset($_SESSION["Error_2"])) $_SESSION["Error_2"] = ''; if (!isset($_SESSION["Error_3"])) $_SESSION["Error_3"] = ''; if (!isset($_SESSION["Error_4"])) $_SESSION["Error_4"] = ''; if (!isset($_SESSION["Error_5"])) $_SESSION["Error_5"] = ''; if (!isset($_SESSION["Current"])) $_SESSION["Current"] = ''; if (!isset($_SESSION["DE_Retain"])) $_SESSION["DE_Retain"] = '0'; if (!isset($_SESSION["DE_Comment"])) $_SESSION["DE_Comment"] = ''; // Email Sessions if (!isset($_SESSION["Name"])) $_SESSION["Name"] = ''; if (!isset($_SESSION["Name2"])) $_SESSION["Name2"] = ''; if (!isset($_SESSION["Email"])) $_SESSION["Email"] = ''; if (!isset($_SESSION["Subject"])) $_SESSION["Subject"] = ''; if (!isset($_SESSION["Msg"])) $_SESSION["Msg"] = ''; } <?php // Banking Version 2.0.0 01-12-2023 Desmond O'Toole. error_reporting(E_ALL); ini_set('display_errors', '1'); include_once ("../secure/SecurePDO.php"); include_once ("secure/SecureFunctionsBankPDO.php"); date_default_timezone_set('Europe/London'); session_start(); Session_Init(); $page = "Libray Selection"; if(!isset($_SESSION["Pk"])) { header('Location: index.php'); exit; } $Pk = $_SESSION["Pk"]; if(KeyCheckX($Pk)== 0) { header('Location: index.php'); exit; } $EndTime = KeyTestX($Pk, 0); //SILLY this returns 1 or -1 $_SESSION["current_page"] = $page; $Comment_Name = time(); $Comment_Name = dechex(time()); $_SESSION['COMMENT_NAME'] = $Comment_Name; $DD = date('d'); // Default to current date $MM = date('m'); $YYYY = date('Y'); $qBalance = GetBalance(); $Date = $qBalance['EntryDate']; $Value = $qBalance['BalanceValue']; $stamp = strtotime($Date); $_SESSION["DD_Balance"] = date('d' ,$stamp); $_SESSION["MM_Balance"] = date('m' ,$stamp); $_SESSION["YYYY_Balance"] = date('Y' ,$stamp); $_SESSION['C_Forward'] = $Value; $SE_MyReason = $_SESSION['DE_MyReason']; if($_SESSION["DE_DD_Entry"] == "") { $_SESSION["DE_DD_Entry"] = $DD; $_SESSION["DE_MM_Entry"] = $MM; $_SESSION["DE_YYYY_Entry"] = $YYYY; } $ThisYear = date("Y",time()); $NextYear = $ThisYear + 1; $PreviouseYear = $ThisYear - 1; if (!isset($_SESSION['DE_Money_In'])) $_SESSION['DE_Money_In'] = '0.00'; if (!isset($_SESSION['DE_Money_Out'])) $_SESSION['DE_Money_Out'] = '0.00'; if (!isset($_SESSION['DE_Comment'])) $_SESSION['DE_Comment'] = ""; $SE_Money_In = $_SESSION['DE_Money_In']; $SE_Money_Out = $_SESSION['DE_Money_Out']; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Bank Home 2</title> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META http-equiv="imagetoolbar" CONTENT="no"> <link rel="stylesheet" href="stylesheets/Library.css" type="text/css"> <link rel="stylesheet" href="stylesheets/LibraryMenu.css" type="text/css"> </head> <body> <div id="PageTitle"> <img src="images/LibraryBanner.jpg" alt=""> </div> <?php include('SideMenu.php'); ?> <div id="PageContent"> <form action="DataInputUpdate.php" method="post"> <h3>User: <?=greeting() . " Ends on " . $EndTime ?></h3> <div style="width:650px;height:60px;padding:10px;overflow:hidden;"> <div style="width:440px;float:left;"> Date: Carried forward: £<span style="color:red;"><?=$_SESSION['Error_3'] ?></span> <input type="text" maxlength="10" size="5" name="BF" style="text-align:right" value="<?=$_SESSION['C_Forward'] ?>" > <select name="DD_Balance" style="width:40px"> <?php for($days=1;$days<32;$days++) { ?> <option value="<?=$days ?>" <?php if ($_SESSION["DD_Balance"] == $days){ ?> SELECTED <?php } ?>><?=$days ?></option> <?php } ?> </select> <select name="MM_Balance" style="width:60px"> <option value="1" <?php if ($_SESSION["MM_Balance"] == "1"){ ?> SELECTED <?php } ?>>Jan</option> <option value="2" <?php if ($_SESSION["MM_Balance"] == "2"){ ?> SELECTED <?php } ?>>Feb</option> <option value="3" <?php if ($_SESSION["MM_Balance"] == "3"){ ?> SELECTED <?php } ?>>Mar</option> <option value="4" <?php if ($_SESSION["MM_Balance"] == "4"){ ?> SELECTED <?php } ?>>Apr</option> <option value="5" <?php if ($_SESSION["MM_Balance"] == "5"){ ?> SELECTED <?php } ?>>May</option> <option value="6" <?php if ($_SESSION["MM_Balance"] == "6"){ ?> SELECTED <?php } ?>>Jun</option> <option value="7" <?php if ($_SESSION["MM_Balance"] == "7"){ ?> SELECTED <?php } ?>>July</option> <option value="8" <?php if ($_SESSION["MM_Balance"] == "8"){ ?> SELECTED <?php } ?>>Aug</option> <option value="9" <?php if ($_SESSION["MM_Balance"] == "9"){ ?> SELECTED <?php } ?>>Sep</option> <option value="10" <?php if ($_SESSION["MM_Balance"] == "10"){ ?> SELECTED <?php } ?>>Oct</option> <option value="11" <?php if ($_SESSION["MM_Balance"] == "11"){ ?> SELECTED <?php } ?>>Nov</option> <option value="12" <?php if ($_SESSION["MM_Balance"] == "12"){ ?> SELECTED <?php } ?>>Dec</option> </select> <select name="YYYY_Balance" style="width:60px"> <?php if($MM == 1) { ?> <option value="<?=$PreviouseYear ?>" <?php if($_SESSION["YYYY_Balance"] == $PreviouseYear){ ?> SELECTED <?php } ?> ><?=$PreviouseYear ?></option> <?php } ?> <option value="<?=$ThisYear ?>" <?php if($_SESSION["YYYY_Balance"] == $ThisYear){ ?> SELECTED <?php } ?> ><?=$ThisYear ?></option> <?php if($MM == 12 || $MM == 11 && $DD > 19) { ?> <option value="<?=$NextYear ?>" <?php if($_SESSION["YYYY_Balance"] == $NextYear){ ?> SELECTED <?php } ?> ><?=$NextYear ?></option> <?php } ?> </select> </div> <br><br> <div style="float:left;clear:both;"><input class="MyButton"type="submit" name="direction" value="Prev Balance"></div> </div> <div style="width:650px;height:10px;padding:10px;overflow: hidden;"> <select name="DD_Entry" style="width:40px"> <?php for($days=1;$days<32;$days++) { ?> <option value="<?=$days ?>" <?php if ($_SESSION["DE_DD_Entry"] == $days){ ?> SELECTED <?php }?>><?=$days ?></option> <?php } ?> </select> <select name="MM_Entry" style="width:60px"> <option value="1" <?php if ($_SESSION["DE_MM_Entry"] == "1"){ ?> SELECTED <?php } ?>>Jan</option> <option value="2" <?php if ($_SESSION["DE_MM_Entry"] == "2"){ ?> SELECTED <?php } ?>>Feb</option> <option value="3" <?php if ($_SESSION["DE_MM_Entry"] == "3"){ ?> SELECTED <?php } ?>>Mar</option> <option value="4" <?php if ($_SESSION["DE_MM_Entry"] == "4"){ ?> SELECTED <?php } ?>>Apr</option> <option value="5" <?php if ($_SESSION["DE_MM_Entry"] == "5"){ ?> SELECTED <?php } ?>>May</option> <option value="6" <?php if ($_SESSION["DE_MM_Entry"] == "6"){ ?> SELECTED <?php } ?>>Jun</option> <option value="7" <?php if ($_SESSION["DE_MM_Entry"] == "7"){ ?> SELECTED <?php } ?>>July</option> <option value="8" <?php if ($_SESSION["DE_MM_Entry"] == "8"){ ?> SELECTED <?php } ?>>Aug</option> <option value="9" <?php if ($_SESSION["DE_MM_Entry"] == "9"){ ?> SELECTED <?php } ?>>Sep</option> <option value="10" <?php if ($_SESSION["DE_MM_Entry"] == "10"){ ?> SELECTED <?php } ?>>Oct</option> <option value="11" <?php if ($_SESSION["DE_MM_Entry"] == "11"){ ?> SELECTED <?php } ?>>Nov</option> <option value="12" <?php if ($_SESSION["DE_MM_Entry"] == "12"){ ?> SELECTED <?php } ?>>Dec</option> </select> <select name="YYYY_Entry" style="width:60px"> <?php if($MM == '1' && $DD < 7) { ?> <option value="<?=$PreviouseYear ?>" <?php if ($_SESSION["DE_YYYY_Entry"] == $PreviouseYear){ ?> SELECTED <?php } ?> ><?=$PreviouseYear ?></option> <?php } ?> <option value="<?=$ThisYear ?>" <?php if ($_SESSION["DE_YYYY_Entry"] == $ThisYear){ ?> SELECTED <?php } ?> ><?=$ThisYear ?></option> <?php if($MM > 10) { ?> <option value="<?=$NextYear ?>" <?php if ($_SESSION["DE_YYYY_Entry"] == $NextYear){ ?> SELECTED <?php } ?> ><?=$NextYear ?></option> <?php } ?> </select> <span style="color:red;"><?=$_SESSION['Error_5'] ?></span> </div> <div style="width:650px;height:60px;padding:10px;overflow: hidden;"> Money in: £ <input style="text-align:right;" type="text" maxlength="10" size="4" name="MoneyIn" value="<?=$SE_Money_In ?>" size="8"> <!-- <span style="color:red;"><?=$_SESSION['Error_6'] ?></span> --> <br><br> Money Out: £ <input style="text-align:right;" type="text" maxlength="10" size="4" name="MoneyOut" value="<?=$SE_Money_Out ?>" size="8"> <!-- <span style="color:red;"><?=$_SESSION['Error_7'] ?></span> --> </div> <div style="width:650px;height:90px;padding:10px;overflow:hidden;"> Reason: <?php $qReason = GetReason(); ?> <select name="Reason"> <?php while($row = $qReason->fetch()) { ?> <option value="<?=$row['ReasonID'] ?>" <?php if($SE_MyReason == $row['ReasonID']) { ?> selected <?php } ?> ><?=$row['Reason'] ?></option> <?php } ?> </select> <span style="color:red;"><?=$_SESSION['Error_8'] ?><br><br></span> Max 32 Characters<br> Comment <input type="text" maxlength="32" size="42" name= "<?=$Comment_Name ?>" value="<?=$_SESSION["DE_Comment"] ?>"><br><br> </div> <?php if($_SESSION["DE_Retain"] == 1) { ?> Retain comment: <input type="checkbox" maxlength="1" size="1" name="Retain" checked> <?php } else { ?> Retain comment: <input type="checkbox" maxlength="1" size="1" name="Retain"> <?php } ?> <div style="width:650px;height:40px;padding:10px;overflow:hidden;"> Hi-light <input type="checkbox" maxlength="1" size="1" name="Bold"> </div> <div style="width:460px;height:90px;padding:10px;overflow:hidden;"> <input class="MyButton"type="submit" name="direction" value="Add record"><br><br><br> <input class="MyButton"type="submit" name="direction" value="Statement"> </div> </div> </form> </body> </html>
-
With your checkbox logic. If a checkbox is not checked it does not get posted unlike other controls on a web page.
-
Dragon queen it is a bit more complicated than that. I have a form with text boxes and drop-down boxes. I want one text box to retain the contents when after submitting the page to another code page and then returning back. This is stored in a session variable. I have added a check box to indicate that I want to retain the content. if unchecked then it forgets and I get a blank text box. Attached is an image of the page and the complete code. P.S. On working this through. Is there a function to clear all my session variables so I can start with a clean sheet? http://desmond-otoole.co.uk/Comment.jpg Comment <input type="text" maxlength="32" size="42" name= "<?=$Comment_Name ?>" value="<?=$_SESSION["DE_Comment"] ?>"><br><br> </div> <?php if($_SESSION["DE_Retain"] == 1) { ?> Retain comment: <input type="checkbox" maxlength="1" size="1" name="Retain" checked> <?php } else { ?> Retain comment: <input type="checkbox" maxlength="1" size="1" name="Retain"> <?php } ?> <div style="width:650px;height:40px;padding:10px;overflow:hidden;">
-
Thanks for all your help. I will try and indent better. I am using Notepad++ but it doesn't always get it right. as for using {} it can be confusing when diving in and out of PHP and HTML so I will keep to always using them in the future. Thanks for all your help here
-
I thought that you only needed to use the brackets if there is more than one condition. So this is the correct format? Never thought of it as spagetti code. <?php if($_SESSION["DE_Retain"] == 1) { ?> <input type="text" maxlength="32" size="42" name= "<?=$Comment_Name ?>" value="Des"> Max 32 Characters<br><br> <?php } else { ?> <input type="text" maxlength="32" size="42" name= "<?=$Comment_Name ?>" value="Dave"> Max 32 Characters<br><br> <?php } ?>
-
Hi. Can someone tell me why I cant use the else in this if statment please? <?php if($_SESSION["DE_Retain"] == 1) ?> <input type="text" maxlength="32" size="42" name= "<?=$Comment_Name ?>"; value="Des"> Max 32 Characters<br><br> <?php else ?> <input type="text" maxlength="32" size="42" name= "<?=$Comment_Name ?>"; value="Dave"> Max 32 Characters<br><br>
-
Thanks for that. Can't think how that was not copied down to the next line.
-
Hi. I have a drop down box that should show years 2024 and 2025. I can not get the next year to be included if today is greater than 19th November. Can any help with this please. This is on lines 134 - 139. The current date $DD $MM and $YYYY are automaticaly set anyway on lines 31 to 33. And the years are established on lines 53 to 55. <?php // Banking Version 2.0.0 01-12-2023 Desmond O'Toole. error_reporting(E_ALL); ini_set('display_errors', '1'); include_once ("secure/SecureFunctionsBankPDO.php"); include_once ("../secure/SecurePDO.php"); date_default_timezone_set('Europe/London'); session_start(); Session_Init(); $page = "Libray Selection"; if(!isset($_SESSION["Pk"])) { header('Location: index.php'); exit; } $Pk = $_SESSION["Pk"]; if(KeyCheckX($Pk)== 0) { header('Location: index.php'); exit; } $EndTime = KeyTestX($Pk, 0); //SILLY this returns 1 or -1 $_SESSION["current_page"] = $page; $Comment_Name = time(); $Comment_Name = dechex(time()); $_SESSION['COMMENT_NAME'] = $Comment_Name; $DD = date('d'); // Default to current date $MM = date('m'); $YYYY = date('Y'); $qBalance = GetBalance(); $Date = $qBalance['EntryDate']; $Value = $qBalance['BalanceValue']; $stamp = strtotime($Date); $_SESSION["DD_Balance"] = date('d' ,$stamp); $_SESSION["MM_Balance"] = date('m' ,$stamp); $_SESSION["YYYY_Balance"] = date('Y' ,$stamp); $_SESSION['C_Forward'] = $Value; $SE_MyReason = $_SESSION['DE_MyReason']; if($_SESSION["DE_DD_Entry"] == "") { $_SESSION["DE_DD_Entry"] = $DD; $_SESSION["DE_MM_Entry"] = $MM; $_SESSION["DE_YYYY_Entry"] = $YYYY; } $ThisYear = date("Y",time()); $NextYear = $ThisYear + 1; $PreviouseYear = $ThisYear - 1; if (!isset($_SESSION['DE_Money_In'])) $_SESSION['DE_Money_In'] = '0.00'; if (!isset($_SESSION['DE_Money_Out'])) $_SESSION['DE_Money_Out'] = '0.00'; if (!isset($_SESSION['DE_Comment'])) $_SESSION['DE_Comment'] = ""; $SE_Money_In = $_SESSION['DE_Money_In']; $SE_Money_Out = $_SESSION['DE_Money_Out']; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Bank Home 2</title> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META http-equiv="imagetoolbar" CONTENT="no"> <link rel="stylesheet" href="stylesheets/Library.css" type="text/css"> <link rel="stylesheet" href="stylesheets/LibraryMenu.css" type="text/css"> </head> <body> <div id="PageTitle"> <img src="images/LibraryBanner.jpg" alt=""> </div> <?php include('SideMenu.php'); ?> <div id="PageContent"> <form action="DataInputUpdate.php" method="post"> <h3>User: <?=greeting() . " Ends on " . $EndTime ?></h3> <div style="width:650px;height:60px;padding:10px;overflow:hidden;"> <div style="width:440px;float:left;"> Date: Carried forward: £<span style="color:red;"><?=$_SESSION['Error_3'] ?></span> <input type="text" maxlength="10" size="5" name="BF" style="text-align:right" value="<?=$_SESSION['C_Forward'] ?>" > <select name="DD_Balance" style="width:40px"> <?php for($days=1;$days<32;$days++) { ?> <option value="<?=$days ?>" <?php if ($_SESSION["DD_Balance"] == $days){ ?> SELECTED <?php } ?>><?=$days ?></option> <?php } ?> </select> <select name="MM_Balance" style="width:60px"> <option value="1" <?php if ($_SESSION["MM_Balance"] == "1"){ ?> SELECTED <?php } ?>>Jan</option> <option value="2" <?php if ($_SESSION["MM_Balance"] == "2"){ ?> SELECTED <?php } ?>>Feb</option> <option value="3" <?php if ($_SESSION["MM_Balance"] == "3"){ ?> SELECTED <?php } ?>>Mar</option> <option value="4" <?php if ($_SESSION["MM_Balance"] == "4"){ ?> SELECTED <?php } ?>>Apr</option> <option value="5" <?php if ($_SESSION["MM_Balance"] == "5"){ ?> SELECTED <?php } ?>>May</option> <option value="6" <?php if ($_SESSION["MM_Balance"] == "6"){ ?> SELECTED <?php } ?>>Jun</option> <option value="7" <?php if ($_SESSION["MM_Balance"] == "7"){ ?> SELECTED <?php } ?>>July</option> <option value="8" <?php if ($_SESSION["MM_Balance"] == "8"){ ?> SELECTED <?php } ?>>Aug</option> <option value="9" <?php if ($_SESSION["MM_Balance"] == "9"){ ?> SELECTED <?php } ?>>Sep</option> <option value="10" <?php if ($_SESSION["MM_Balance"] == "10"){ ?> SELECTED <?php } ?>>Oct</option> <option value="11" <?php if ($_SESSION["MM_Balance"] == "11"){ ?> SELECTED <?php } ?>>Nov</option> <option value="12" <?php if ($_SESSION["MM_Balance"] == "12"){ ?> SELECTED <?php } ?>>Dec</option> </select> <select name="YYYY_Balance" style="width:60px"> <?php if($MM == 1) { ?> <option value="<?=$PreviouseYear ?>" <?php if($_SESSION["YYYY_Balance"] == $PreviouseYear){ ?> SELECTED <?php } ?> ><?=$PreviouseYear ?></option> <?php } ?> <option value="<?=$ThisYear ?>" <?php if($_SESSION["YYYY_Balance"] == $ThisYear){ ?> SELECTED <?php } ?> ><?=$ThisYear ?></option <?php if($MM == 12 || $MM == 11 && $DD > 19) { ?> <option value="<?=$NextYear ?>" <?php if($_SESSION["YYYY_Balance"] == $NextYear){ ?> SELECTED <?php } ?> ><?=$NextYear ?></option> <?php } ?> </select> </div> <br><br> <div style="float:left;clear:both;"><input class="MyButton"type="submit" name="direction" value="Prev Balance"></div> </div> <div style="width:650px;height:10px;padding:10px;overflow: hidden;"> <select name="DD_Entry" style="width:40px"> <?php for($days=1;$days<32;$days++) { ?> <option value="<?=$days ?>" <?php if ($_SESSION["DE_DD_Entry"] == $days){ ?> SELECTED <?php }?>><?=$days ?></option> <?php } ?> </select> <select name="MM_Entry" style="width:60px"> <option value="1" <?php if ($_SESSION["DE_MM_Entry"] == "1"){ ?> SELECTED <?php } ?>>Jan</option> <option value="2" <?php if ($_SESSION["DE_MM_Entry"] == "2"){ ?> SELECTED <?php } ?>>Feb</option> <option value="3" <?php if ($_SESSION["DE_MM_Entry"] == "3"){ ?> SELECTED <?php } ?>>Mar</option> <option value="4" <?php if ($_SESSION["DE_MM_Entry"] == "4"){ ?> SELECTED <?php } ?>>Apr</option> <option value="5" <?php if ($_SESSION["DE_MM_Entry"] == "5"){ ?> SELECTED <?php } ?>>May</option> <option value="6" <?php if ($_SESSION["DE_MM_Entry"] == "6"){ ?> SELECTED <?php } ?>>Jun</option> <option value="7" <?php if ($_SESSION["DE_MM_Entry"] == "7"){ ?> SELECTED <?php } ?>>July</option> <option value="8" <?php if ($_SESSION["DE_MM_Entry"] == "8"){ ?> SELECTED <?php } ?>>Aug</option> <option value="9" <?php if ($_SESSION["DE_MM_Entry"] == "9"){ ?> SELECTED <?php } ?>>Sep</option> <option value="10" <?php if ($_SESSION["DE_MM_Entry"] == "10"){ ?> SELECTED <?php } ?>>Oct</option> <option value="11" <?php if ($_SESSION["DE_MM_Entry"] == "11"){ ?> SELECTED <?php } ?>>Nov</option> <option value="12" <?php if ($_SESSION["DE_MM_Entry"] == "12"){ ?> SELECTED <?php } ?>>Dec</option> </select> <select name="YYYY_Entry" style="width:60px"> <?php if($MM == '1' && $DD < 7) { ?> <option value="<?=$PreviouseYear ?>" <?php if ($_SESSION["DE_YYYY_Entry"] == $PreviouseYear){ ?> SELECTED <?php } ?> ><?=$PreviouseYear ?></option> <?php } ?> <option value="<?=$ThisYear ?>" <?php if ($_SESSION["DE_YYYY_Entry"] == $ThisYear){ ?> SELECTED <?php } ?> ><?=$ThisYear ?></option> <?php if($MM > '10') { ?> <option value="<?=$NextYear ?>" <?php if ($_SESSION["YYYY_Balance"] == $NextYear){ ?> SELECTED <?php } ?> ><?=$NextYear ?></option> <?php } ?> </select> <span style="color:red;"><?=$_SESSION['Error_5'] ?></span> </div> <div style="width:650px;height:60px;padding:10px;overflow: hidden;"> Money in: £ <input style="text-align:right;" type="text" maxlength="10" size="4" name="MoneyIn" value="<?=$SE_Money_In ?>" size="8"> <!-- <span style="color:red;"><?=$_SESSION['Error_6'] ?></span> --> <br><br> Money Out: £ <input style="text-align:right;" type="text" maxlength="10" size="4" name="MoneyOut" value="<?=$SE_Money_Out ?>" size="8"> <!-- <span style="color:red;"><?=$_SESSION['Error_7'] ?></span> --> </div> <div style="width:650px;height:70px;padding:10px;overflow:hidden;"> Reason: <?php $qReason = GetReason(); ?> <select name="Reason"> <?php while($row = $qReason->fetch()) { ?> <option value="<?=$row['ReasonID'] ?>" <?php if($SE_MyReason == $row['ReasonID']) { ?> selected <?php } ?> ><?=$row['Reason'] ?></option> <?php } ?> </select> <span style="color:red;"><?=$_SESSION['Error_8'] ?><br><br></span> Comment <input type="text" maxlength="32" size="42" name= "<?=$Comment_Name ?>"; value=""> Max 32 Characters </div> <div style="width:650px;height:40px;padding:10px;overflow:hidden;"> Hi-light <input type="checkbox" maxlength="1" size="1" name="Bold"> </div> <div style="width:460px;height:90px;padding:10px;overflow:hidden;"> <input class="MyButton"type="submit" name="direction" value="Add record"><br><br><br> <input class="MyButton"type="submit" name="direction" value="Statement"> </div> </div> </form> </body> </html>
-
Sorry server files are out of dat. Thanks anyway.
-
Sorry this is in addition to a previouse post which is fixed. Can someone help with transferring to PDO. I have added another field to the end of a table Bank_Data field called ‘B’ for Bold entry. $Bold added into function UpdateRecord() at the end lines 229 to 254 in SecureFunctionsBankPDO.php Parse error: syntax error, unexpected token "?", expecting end of file in SecureFunctionsBankPDO.php on line 271 Thanks. SecureFunctionsBankPDO.php.txt
-
I used if set = 1 else 0. Posted returns 'On'' not a 1. Thanks.
-
Hi I have added a checkbox to a for [Bold] When submitted to the update php I get echo $Bold; On if it is ticked and Warning: Undefined array key "Bold" in /vhost/d/e/s/desmond-otoole.co.uk/www/bank2/StatementEntryUpdate.php on line 31 if it is not. Can someone help please. <code if($direction == "Update") { $SE_MyReason = $_POST['Reason']; // Keep the default regardless $SE_Money_In = $_POST['MoneyIn']; $SE_Money_Out = $_POST['MoneyOut']; $SE_DD_Entry = $_POST['DD_Entry']; $SE_MM_Entry = $_POST['MM_Entry']; $SE_YYYY_Entry = $_POST['YYYY_Entry']; $Comment = $_POST['Comment']; $Bold = $_POST['Bold']; <--- Line 31 echo $Bold; exit; </code>
-
Thanks. Stupid mistake to make.