Paul-D
Members-
Posts
140 -
Joined
-
Last visited
Paul-D's Achievements
Advanced Member (4/5)
0
Reputation
-
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."