
Paul-D
Members-
Posts
150 -
Joined
-
Last visited
Everything posted by Paul-D
-
I fixed the wrong quote but there is still an error. When I put the code into Notepad++ Line 8 is a blank line under create table section. MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(3, 2, 'Virgin Bank','#000000'), (4, 3, '_Spare_2','#000000'), (5, 4, 'CT','#f' at line 8 DROP TABLE IF EXISTS `Bank_Reason`; CREATE TABLE IF NOT EXISTS `Bank_Reason` ( `ID` int(11) NOT NULL, `ReasonID` int(11) DEFAULT NULL, `Reason` varchar(20) DEFAULT NULL, `Colour` varchar(8) DEFAULT '#000000' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `Bank_Reason` -- INSERT INTO `Bank_Reason` (`ID`, `ReasonID`, `Reason`,`Colour`) VALUES (1, 0, '---SELECT','#000000'), (2, 1, 'Other',','#0000ff'), (3, 2, 'Virgin Bank','#000000'), (4, 3, '_Spare_2','#000000'), (5, 4, 'CT','#ff00ff'), (6, 5, 'Energy','#c51010'), (7, 6, 'Mobile','#27b30b'), (8, 7, 'Virgin_BB','#06b8b6'), (9, 8, 'MNOPF','#00aa00'), (10, 9, 'Water','#aa7700'), (11, 10, '@Shops','#ff0000'), (12, 11, 'Online','#7777ff'), (13, 12, 'Cash','#000000'), (14, 13, 'Pablo','#000000'), (15, 14, 'Amazon Prime','#000000'), (16, 15, 'Ebay/Paypal','#7a061c'), (17, 16, 'Argos/Store cards','#000000'), (18, 17, 'Alexa Music','#000000'), (19, 18, 'HSBC','#aa00aa'), (20, 19, 'Amazon Orders','#aa7700'), (21, 20, 'State Pension','#301de8'), (22, 21, 'Home Insurance','#000000'), (23, 22, 'Lottery','#000000'), (24, 23, 'Rent','#000000'), (25, 24, 'Private Health','#000000'), (26, 25, 'Credit card **','#000000'), (27, 26, '_Spare_1','#000000');
-
Hi. I have an exsisting table Bank_Reason. I want to add an extra columb 'Colour' to it. I am getting an error when I try to change it. I have done a drop table and recreate. Can any help with this extra columb please. I worked fine before. P.S. I have noticed that i was missing a (`). NEW line INSERT INTO `Bank_Reason` (`ID`, `ReasonID`, `Reason`,`Colour`) VALUES. Makes no diffrence. DROP TABLE IF EXISTS `Bank_Reason`; CREATE TABLE IF NOT EXISTS `Bank_Reason` ( `ID` int(11) NOT NULL, `ReasonID` int(11) DEFAULT NULL, `Reason` varchar(20) DEFAULT NULL, `Colour` varchar(8) DEFAULT '#000000' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `Bank_Reason` -- INSERT INTO `Bank_Reason` (`ID`, `ReasonID`, `Reason`,Colour') VALUES (1, 0, '---SELECT','#000000'), (2, 1, 'Other',','#0000ff'), (3, 2, 'Virgin Bank','#000000'), (4, 3, '_Spare_2','#000000'), (5, 4, 'CT','#ff00ff'), (6, 5, 'Energy','#c51010'), (7, 6, 'Mobile','#27b30b'), (8, 7, 'Virgin_BB','#06b8b6'), (9, 8, 'MNOPF','#00aa00'), (10, 9, 'Water','#aa7700'), (11, 10, '@Shops','#ff0000'), (12, 11, 'Online','#7777ff'), (13, 12, 'Cash','#000000'), (14, 13, 'Pablo','#000000'), (15, 14, 'Amazon Prime','#000000'), (16, 15, 'Ebay/Paypal','#7a061c'), (17, 16, 'Argos/Store cards','#000000'), (18, 17, 'Alexa Music','#000000'), (19, 18, 'HSBC','#aa00aa'), (20, 19, 'Amazon Orders','#aa7700'), (21, 20, 'State Pension','#301de8'), (22, 21, 'Home Insurance','#000000'), (23, 22, 'Lottery','#000000'), (24, 23, 'Rent','#000000'), (25, 24, 'Private Health','#000000'), (26, 25, 'Credit card **','#000000'), (27, 26, '_Spare_1','#000000');
-
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.
-
I realise that there are other ways of doing this but I can't rip it up now and start again. I have a system which has worked for years. I need to work out why I am not getting a match in... I have tested the values in the function and they are correct. I am getting back #c53ba1 in all the returns. function GetColour($Balls,$Ball) { $found = "#c53ba1"; for($a = 0;$a <5; $a++) { if($Balls[$a] == $Ball) $found == "#0000ff"; } return $found; }
-
Hi I have a lottery viewer which works. What I want to do is check if a number is a match and change the colour of the ball. Right now it just returns 0 or 1. I thought black 000000 normal and blue 0000ff. Is there a way of deleting the code section. Spelling mistake $Colour? Tried to delete. ## Page <?php $found = GetColur($MyBalls,$rsLottoList['N1']); ?> <td style="text-align:right"><?=$rsLottoList['N1']?></td> ## Code function GetColur($Balls,$Ball) { $found = 0; for($a = 0;$a <5; $a++) { if($Balls[$a] == $Ball) $found = 1; } return $found; }
-
Okay thanks. I am the sole user of this and the table is relativly tiny. Holds all the euros from Feb 2004. Thanks though.
-
function GetAllData() { $pdo = connectDB(); $sqlLottoList = "SELECT * FROM EuroMillions ORDER BY Draw DESC"; $stmt = $pdo->prepare($sqlLottoList); $stmt->execute(); $stmt->fetch(); echo $stmt['N1']; // Test line 22 exit; return $stmt; } Fatal error: Uncaught Error: Cannot use object of type PDOStatement as array in /vhost/d/e/s/desmond-otoole.co.uk/www/Lottery2/secure/LotteryFunctionsPDO.php:22 Should return tinyint(1) value 16 /* first row in table. */
-
Thanks gizmola
-
I only put BST to show what it represented. I have inspected the code and got this... Don't know where I am supposed to be lookimg.
-
Canm you tell me how I do this... you can look at the response headers in the browser's developer tools Also I have added HTML to the test page to invoke no cashing. Can someone check this also. I have set it to a 10 second refresh... <?php error_reporting(E_ALL); ini_set('display_errors', '1'); date_default_timezone_set('Europe/London'); $t_stamp = time(); $Nice = date("d-M-Y H:i:s",$t_stamp); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Date Test</title> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META http-equiv="imagetoolbar" CONTENT="no"> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Expires" content="0"> <meta http-equiv="refresh" content="10"> <link rel="stylesheet" href="stylesheets/Library.css" type="text/css"> <link rel="stylesheet" href="stylesheets/LibraryMenu.css" type="text/css"> </head> <body> <H2>This is done with no browser cashing.</H2> Today is <?=$Nice;?> BST. </body> </html> Also. I lot's of websites have a timeout forcing people to log in again. How can this be done if it is cashed or is it done another way? I do it by refreshing and getting the time. They also said the coding being used would need to be set up to bypass the caching. and I am doing this.
-
Can someone help me with a reply from easyspace as it is confusing. [disabling varnish caching] "Our senior administration team have reviewed the server/time issue as requested. They have advised that the issue is a caching problem and that the coding being used would need to be set up to bypass the caching. Alternatively, they have suggested disabling varnish caching for further testing. This can be done by our technical team if you wish to test this."