
Paul-D
Members-
Posts
150 -
Joined
-
Last visited
Everything posted by Paul-D
-
This is waht I get when I supply m EXACTLY as he has given it to me. I get this error Warning: Missing argument 3 for LogMeX2(), called in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/bank2/LogMe.php on line 74 and defined in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/secure/SecurePDO.php on line 81 Fatal error: Call to a member function prepare() on a non-object in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/secure/SecurePDO.php on line 84 And here is the entire code <?php error_reporting(E_ALL); ini_set('display_errors', '1'); define ('HOSTNAME1', 'mysql09.iomart.com'); define ('USERNAME1', 'otoogc692'); define ('PASSWORD1', 'mauritius'); define ('DATABASE1', 'otoogc692'); function connectDB() { static $pdo = null; if($pdo === null) { $host = HOSTNAME1; $user = USERNAME1; $pass = PASSWORD1; $MyDB = DATABASE1; $pdo = new PDO("mysql:host=$host; dbname=$MyDB; charset=UTF8", $user, $pass, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]); } return $pdo; } 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"] = ''; // 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"] = ''; } function FindMe() { $CookiePresent = 0; if (isset($_COOKIE["Headquarters"])) { if($_COOKIE["Headquarters"] == "Bananarama") $CookiePresent = 1; } return $CookiePresent; } function LogMeX2($pdo,$username,$password) { $sql = "SELECT User, UserKey FROM LIBusersX WHERE UserN = ?"; $stmt = $pdo->prepare($sql); $stmt->execute([$username]); // fetch/test if a row was found, i.e. the username was found if(!$row = $stmt->fetch()) { // username not found return false; } // username found, test password if(!password_verify($password,$row['UserKey'])) { // passwrod didn't match return false; } // username and password matched, return user id return $row['User']; } ?>
-
mac_gyver. I can't put $pdo into the call to LogMeX"(). The web page is not supplying this connection as it does not know what a database is. I get missmatch. WEBPAGE: $user = LogMeX2($Name , $password); This is not going to work with the function function LogMeX2($pdo,$Name,$password)
-
Forgot to add the code. <?php error_reporting(E_ALL); ini_set('display_errors', '1'); define ('HOSTNAME1', 'mysql09.iomart.com'); define ('USERNAME1', 'otoogc692'); define ('PASSWORD1', 'mauritius'); define ('DATABASE1', 'otoogc692'); function connectDB() { static $pdo = null; if($pdo === null) { $host = HOSTNAME1; $user = USERNAME1; $pass = PASSWORD1; $MyDB = DATABASE1; $pdo = new PDO("mysql:host=$host; dbname=$MyDB; charset=UTF8", $user, $pass, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]); } return $pdo; } 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"] = ''; // 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"] = ''; } function FindMe() { $CookiePresent = 0; if (isset($_COOKIE["Headquarters"])) { if($_COOKIE["Headquarters"] == "Bananarama") $CookiePresent = 1; } return $CookiePresent; } function LogMeX2($name , $pwd1) { connectDB(); $Name = md5($name); $Pwd1 = md5($pwd1); $ret = 0; $qValid = $pdo->query("SELECT COUNT(*) FROM LIBusersX WHERE UserKey = '$Pwd1' AND UserN = '$Name'"); $total = $qValid ->fetchcolumn(); // Should only be 1 or 0. if($total == 1) { $qUser = $pdo->query("SELECT User FROM LIBusersX WHERE UserKey = '$Pwd1' AND UserN = '$Name'"); $rs = $qUser->fetch(); $ret = $rs['User']; // Should return 0 or id of the user. } return $ret; } ?>
-
well I have done everything you sugested. I used a function ConnectDB() I used a static variable. but in the called routine function LogMeX2($name , $pwd1) I get Notice: Undefined variable: pdo in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/secure/SecurePDO.php on line 87. This is what I got from Kicken yesterday 08:03 but by popular request renamed $pdo
-
I was told that backslash was no longer used as an escape sequence but you need it if you have to insert an apostraphy into a database table like O\'Rilley. I have tried to delete this inserted code but it won't let me. Right click no delete. <?php error_reporting(E_ALL); ini_set('display_errors', '1'); define ('HOSTNAME1', 'mysql09.iomart.com'); define ('USERNAME1', 'otoogc692'); define ('PASSWORD1', 'mauritius'); define ('DATABASE1', 'otoogc692'); function connectDB() { static $pdo = null; if($pdo === null) { $host = HOSTNAME1; $user = USERNAME1; $pass = PASSWORD1; $MyDB = DATABASE1; $conn = new PDO("mysql:host=$host; dbname=$MyDB; charset=UTF8", $user, $pass, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]); } return $pdf; } function LogMeX2($name , $pwd1, $Sector)fs { connectDB(); $Name = md5($name); $Pwd1 = md5($pwd1); $ret = 0; $qValid = $pdo->query("SELECT current FROM LIBusersX WHERE UserKey = '$Pwd1' AND UserN = '$Name'"); $total = mysql_num_rows($qValid); if($total == 1) { $qUser = $pdo->query("SELECT User FROM LIBusersX WHERE UserKey = '$Pwd1' AND UserN = '$Name'"); $rs = mysql_fetch_array($qUser); $ret = $rs['User']; } return $ret; } ?>
-
Ok will stick with $pdo to see where code needs to change. I have been told or die() will not be supported in PHP7. So has been removed. This needs to change: $total = mysql_num_rows($qValid); What is the equivalent in PDO and fetching an array $rs = mysql_fetch_array($qUser); function LogMeX2($name , $pwd1, $Sector) // E101 { $Name = md5($name); $Pwd1 = md5($pwd1); $valid = 0; $ret = 0; $qValid = $pdo->query("SELECT current FROM LIBusersX WHERE UserKey = '$Pwd1' AND UserN = '$Name'"); $total = mysql_num_rows($qValid); if($total == 1) { $qUser = $pdo->query("SELECT User FROM LIBusersX WHERE UserKey = '$Pwd1' AND UserN = '$Name'"); $rs = mysql_fetch_array($qUser); $ret = $rs['User']; } return $ret; }
-
He insisted that I had used $pdo myself. Can you tell me if this is compulsary and that $conn (which i have always used) is okay to use. He said that I have to put the connection at the top of the page and to pass the connection to the function. This canot work for me as I say next. You say you are nice frendly people so be nice not threaten "I am going to close this topic down." *** My original post which was to convert mysql to PDF recommended by Barand. I supplied this code originally which has a database object $conn not $pdo. He said Don't connect every time you perform a query. Connect once at the top of the script, storing the connection in $pdo. Does this mean you must not have a connection called $conn? I am using $conn all over the place. I was told to pass the connection to the function. The problem is that I have a special functions file with over 80 functions all requiring a database connection. I have calls to these functions all over my website with web pages that don’t understand databases and can not supply a database object. A web page simply wants to know how many customers I have so calls the function as $Totals = TotalCustomers(); My function is going to require a connection as TotalCustomers($conn) which is an agrument miss match. The only way I can see of doing this is to make repeated connection calls. function TotalCustomers() { connectDB(); // code; }
-
yes but Barand cab't read. He used my first atempt and kept to it. He insists that I used $pdo in my code which I did not. He said that he would close my thread down. He clearly was giving me a bloody nose. I do't have the ability do do local host. and the errors I was getting said that $conn was not declared when it was. Looky for me, I got a more frendly helpful forum. Don't bother replying to this as it is closed down now and I wont see the nasty posts.
-
Should have gone to speck savers. I have never used $pdo. I have checked. Posted first code 18 hours ago. No $pdo. I obtained help from another website now. Works fine. I won't be making a donation.
-
Is mac_gyver on line?
-
You are looking at VERY OLD CODE. Look for a $pdo defined as an object in this code. I am doing exactly as you said using $conn. Look at the code I am supplying NOW. I never defined $pdo as an object. Where has $pdo come from? $conn = NEW PDO() makes $conn an object not a $pdo. $conn = new PDO("mysql:host=$host; dbname=$MyDB; charset=UTF8", $user, $pass, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ***** $Result = Contracts($conn); **** function Contracts($conn) { $qList = $conn->query("SELECT * FROM EC_event WHERE ID = 2"); return $qList; } <?php error_reporting(E_ALL); ini_set('display_errors', '1'); define ('HOSTNAME1', 'mysql09.iomart.com'); define ('USERNAME1', 'otoogc692'); define ('PASSWORD1', 'mauritius'); define ('DATABASE1', 'otoogc692'); $host = HOSTNAME1; $user = USERNAME1; $pass = PASSWORD1; $MyDB = DATABASE1; $conn = new PDO("mysql:host=$host; dbname=$MyDB; charset=UTF8", $user, $pass, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]); $Result = Contracts($conn); $MyRow = $Result->fetch(); echo "Value = " . $MyRow['Venue']; function Contracts($conn) { $qList = $conn->query("SELECT * FROM EC_event WHERE ID = 2"); return $qList; } ?>
-
I do not have a $pdo in my code ANYWHERE.. I do have a $conn as in $conn = new PDO ( ... $conn is a connection object is it not. Where is $pdo in my code. The variable $pdo can not be defined in a function if it does not exsist. I am using $conn as an obcect as in $con = NEW
-
I did say that I am out of my depth here but if you mean that you close the thread then do so. I am passing it EVERY WHERE NOW. I am asking for help. You could politly tell me this is what you need to do. No chance of that. <?php error_reporting(E_ALL); ini_set('display_errors', '1'); define ('HOSTNAME1', 'mysql09.iomart.com'); define ('USERNAME1', 'otoogc692'); define ('PASSWORD1', 'mauritius'); define ('DATABASE1', 'otoogc692'); $host = HOSTNAME1; $user = USERNAME1; $pass = PASSWORD1; $MyDB = DATABASE1; $conn = new PDO("mysql:host=$host; dbname=$MyDB; charset=UTF8", $user, $pass, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]); $Result = Contracts($conn); $MyRow = $Result->fetch(); echo "Value = " . $MyRow['Venue']; function Contracts($conn) { $qList = $conn->query("SELECT * FROM EC_event WHERE ID = 2"); return $qList; } ?>
-
Have made alterations from the https://phpdelusions.net/ examples. Still get Undefined variable: conn in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/PDOtest2.php on line 26 <?php error_reporting(E_ALL); ini_set('display_errors', '1'); define ('HOSTNAME1', 'mysql09.iomart.com'); define ('USERNAME1', 'otoogc692'); define ('PASSWORD1', 'mauritius'); define ('DATABASE1', 'otoogc692'); $host = HOSTNAME1; $user = USERNAME1; $pass = PASSWORD1; $MyDB = DATABASE1; $conn = new PDO("mysql:host=$host; dbname=$MyDB; charset=UTF8", $user, $pass, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]); $Result = Contracts(); $MyRow = $Result->fetch(); echo "Value = " . $MyRow['Venue']; function Contracts() { $qList = $conn->query("SELECT * FROM EC_event WHERE ID = 2"); return $qList; } ?>
-
Have made alterations from the https://phpdelusions.net/ examples. Still get Undefined variable: conn in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/PDOtest2.php on line 26 <?php error_reporting(E_ALL); ini_set('display_errors', '1'); define ('HOSTNAME1', 'mysql09.iomart.com'); define ('USERNAME1', 'otoogc692'); define ('PASSWORD1', 'mauritius'); define ('DATABASE1', 'otoogc692'); $host = HOSTNAME1; $user = USERNAME1; $pass = PASSWORD1; $MyDB = DATABASE1; $conn = new PDO("mysql:host=$host; dbname=$MyDB; charset=UTF8", $user, $pass, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_EMULATE_PREPARES => false, ]); $Result = Contracts(); $MyRow = $Result->fetch(); echo "Value = " . $MyRow['Venue']; function Contracts() { $qList = $conn->query("SELECT * FROM EC_event WHERE ID = 2"); return $qList; } ?>
-
Sorry typo. This should be $Result = Contracts(); $MyRow = $Result->fetch(); echo "Value = " . $MyRow['Venue'];
-
Okay. I have this code which results in Notice: Undefined variable: conn in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/PDOtest2.php on line 25 Fatal error: Call to a member function query() on a non-object in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/PDOtest2.php on line 25 <?php error_reporting(E_ALL); ini_set('display_errors', '1'); define ('HOSTNAME1', 'mysql09.iomart.com'); define ('USERNAME1', 'otoogc692'); define ('PASSWORD1', 'mauritius'); define ('DATABASE1', 'otoogc692'); $host = HOSTNAME1; $user = USERNAME1; $pass = PASSWORD1; $MyDB = DATABASE1; $conn = new PDO("mysql:host=$host; dbname=$MyDB; charset=UTF8", $user, $pass, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ ]); $Result = Contracts(); $MyRow = $row = $Result->fetch(); echo "Value = " . $MyRow['Venue']; function Contracts() { $qList = $conn->query("SELECT * FROM EC_event WHERE Date = '2020-10-20 17:55:00'"); return $qList; } ?>
-
I can't beleive you said that PHP7 is at end of life. I am using a company called easyspace. They sent me an email that they are upgrading to PHP7 in one weeks time.
-
This should work? but get Notice: Undefined variable: pdo in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/PDOtest2.php on line 29 <?php error_reporting(E_ALL); ini_set('display_errors', '1'); define ('HOSTNAME1', 'mysql09.iomart.com'); define ('USERNAME1', 'otoogc692'); define ('PASSWORD1', 'mauritius'); define ('DATABASE1', 'otoogc692'); define ('SUGARCAIN' , 1); define ('BLANTYRE' , 2); function connectDB() { $host = HOSTNAME1; $user = USERNAME1; $pass = PASSWORD1; $MyDB = DATABASE1; $conn = new PDO("mysql:host=$host; dbname=$MyDB; charset=UTF8", $user, $pass, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ ]); } function Contracts() { connectDB(); $qList = $pdo->query("SELECT * FROM EC_event WHERE Date = '2020-10-20 17:55:00'"); return $qList; // Calling routine uses while ($row = $qList->fetch()) { // echo $row['name']."<br />\n"; } } $Result = Contracts(); $MyRow = $row = $qList->fetch(); echo "Value = " . $MyRow['Venue']; ?>
-
Okay. Is this what I am going to have to do? <?php error_reporting(E_ALL); ini_set('display_errors', '1'); define ('HOSTNAME1', 'mysql09.iomart.com'); define ('USERNAME1', 'otoogc692'); define ('PASSWORD1', 'mauritius'); define ('DATABASE1', 'otoogc692'); define ('SUGARCAIN' , 1); define ('BLANTYRE' , 2); function connectDB() { $host = HOSTNAME1; $user = USERNAME1; $pass = PASSWORD1; $MyDB = DATABASE1; // OLD //mysql_connect($host, $user, $pass); //mysql_select_db($data, $link); // NEW. Got this a StackOverflow forum $conn = new PDO("mysql:host=$host; dbname=$MyDB; charset=UTF8", $user, $pass, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ ]); } function Contracts($id) { connectDB(); $qList = $pdo->query("SELECT * FROM Contracts"); return $qList; // Calling routine uses while ($row = $qList->fetch()) { // echo $row['name']."<br />\n"; } } // https://phpdelusions.net/pdo_examples ?>
-
Okay thanks for that. Can you send me a link to the new connection strings as I kept mine in a securety section were all pages go to.
-
Hi. It has been a long time since I have been involved in PHP programming. Getting old. I have received an email from easyspace telling me of urgent upgrafing from 5.4.45 to 7. How much is this going to affect me. My website does not use classes only strait php codeing.
-
Thanks for your help. This works fine now and saves me a lot of searching. Don't know how to close the request.
-
Thanks for your help. This mostly works. The problem is the variable I retreve for added date is YYYY-MM-DD HH:MM:SS I have checked this out by echoing it. Lines 163 $AddDate = $row['AddDate']; //echo $AddDate; /* 2022-12-20 14:17:00 */ //exit; However when I use it in the tool tip, the HH:MM:SS is missing Lines 196 <div style="width:150px;height:4px;padding:10px;text-align:right;float:left;text-color:green;clear:both;"> <a href="StatementEntry.php?ID=<?=$ID?>" title=<?=$AddDate?>> <?=$ViewDate?></a></div> /* 2022-12-20 Missing HH:MM:SS*/ Here is the full php code. <? // Banking Version 1.0.0 22-07-2015 Desmond O'Toole. error_reporting(E_ALL); ini_set('display_errors', '1'); require("../secure/SecureFunctions.php"); require("secure/SecureFunctionsBank.php"); session_start(); Session_Init(); $page = "Bank Statement"; 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); if(isRoguebot($Browser) == 1) exit; $_SESSION["K9"] = isRobot($Browser); if($_SESSION["current_page"] <> $page && $_SESSION['Event_Log'] == "YES") { // StoreData($page); // mailtoX($page,"Desmonds New Site.",""); } $_SESSION["current_page"] = $page; $filename = filename($_SERVER['PHP_SELF']); //$Update = date("D d-M-Y H:i", filectime($filename)); $qBalance = GetBalance(); $row = mysql_fetch_array($qBalance); $Date = $row['EntryDate']; $Value = $row['BalanceValue']; $stamp = strtotime($Date); $StartDate = date('D d-M-Y' ,$stamp); $stamp = $stamp + (WEEKS * 5) + (DAYS * 1); $EndDataDate = date('D d-M-Y' ,$stamp); //$QueryDate = date('d-M-Y' ,$stamp); $qGetAllData = GetAllData($Date); $curValue = $Value; $Cash = number_format(MonthlyTakings(CASH) , 2, ".", ","); $Shops = number_format(MonthlyTakings(SHOPS) , 2, ".", ","); $Online = number_format(MonthlyTakings(ONLINE) , 2, ".", ","); $Other = number_format(MonthlyTakings(OTHER) , 2, ".", ","); $Ebay = number_format(MonthlyTakings(EBAY) , 2, ".", ","); //$Totals = $Cash + $Shops + $Online + $Other; $Totals = number_format($Cash + $Shops + $Online + $Other + $Ebay , 2, ".", ","); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Bank Home</title> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META http-equiv="imagetoolbar" CONTENT="no"> <meta http-equiv="refresh" content="60"> <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> <? include('SideMenu.php'); ?> <div id="PageContent"> <form action="menu.php" method="post"> <span style="color:blue;"><b>Est: 18-July-2015</b></span> <!-- <?=greeting() . "<br>Ends on 1 " . $EndTime?></h3> --> <h4><?= "Displayed data up to " . $EndDataDate?><?="<br>Log on ends on " . $EndTime?> <a href="DeleteOldData.php"><span style="color:blue">Clear old data</span></a> <br> <br>Last 30 days: <a href="spend.php?ID=0">Total</a> <span style="color:blue;text-decoration:none">£<?=$Totals?> </span> = <a href="spend.php?ID=12">Cash</a> <span style="color:blue;text-decoration:none">£<?=$Cash?></span>, <a href="spend.php?ID=10">Shopping</a> <span style="color:blue;text-decoration:none">£<?=$Shops?></span>, <a href="spend.php?ID=11">Online</a> <span style="color:blue;text-decoration:none">£<?=$Online?></span>, <a href="spend.php?ID=15">Ebay</a> <span style="color:blue;text-decoration:none">£<?=$Ebay?></span>, <a href="spend.php?ID=1">Other</a> <span style="color:blue;text-decoration:none">£<?=$Other?></span> <a href="EntryDate.php">Entry Date</a> <span style="color:blue;text-decoration:none"></span> </h4> </h4> <div style="width:850px;padding:0px;float:left;"> <div style="width:150px;height:10px;padding:10px;float:left;"><b> Date</b> </div> <div style="width:70px;height:10px;padding:10px;float:left;"><b>Money In</b> </div> <div style="width:70px;height:10px;padding:10px;float:left;"><b>Money Out</b> </div> <div style="width:70px;height:10px;padding:10px;float:left;"><b>Balance</b> </div> <div style="width:100px;height:10px;padding:10px;float:left;"><b>Reason</b> </div> <div style="width:250px;height:10px;padding:10px;float:left;"><b>Comment</b> </div> <div style="width:150px;height:4px;padding:10px;text-align:right;float:left;clear:both;"><a style="color:#ae22e2;" href="DataInput.php">* <?=$StartDate?></a> </div> <div style="width:70px;height:4px;padding:10px;text-align:right;float:left;"> </div> <div style="width:70px;height:4px;padding:10px;text-align:right;float:left;"> </div> <div style="width:70px;height:4px;padding:10px;text-align:right;float:left;">£<?=number_format( $Value,2,'.',',')?> </div> <div style="width:100px;height:4px;padding:10px;float:left;"> </div> <div style="width:250px;height:4px;padding:10px;float:left;">Brought forward </div> <? while($row = mysql_fetch_array($qGetAllData)) { $stamp = strtotime($row['EntryDate']); $ViewDate = date('D d-M-Y' ,$stamp); $CurDate = date('D d-M-Y' ,time()); $input = '£' . $row['Input']; if($row['Input'] == '0.00') $input = ""; $out = '£' . $row['Output']; if($row['Output'] == '0.00') $out = ""; $reason = GetReasonName($row['Reason']); $colorSelect = ColourPicker($row['Reason'],$row['EntryDate']); $AddDate = $row['AddDate']; //echo $AddDate; /* 2022-12-20 14:17:00 */ //exit; $curValue = $Value + $row['Input'] - $row['Output']; //$curValue = RestoreDecimal($curValue); $DisplayCurValue = number_format( $curValue,2,'.',','); $Value = $curValue; $Comment = $row['Comment']; $Comment = str_replace("£","£", $Comment); // $Comment, "£", "£" //$pos = strpos ($Comment, "pound"); /*if ($pos != false) { echo $Comment; exit; }*/ $ID = TransposeKey($row['Tag']); //$ID = $row['Tag']; $x = ""; //if($CurDate == $ViewDate) // $x = "background-color:#cdcccc;"; // background-color:#6495ed; if($colorSelect == "#777777") { ?> <div style="width:150px;height:4px;padding:10px;text-align:right;float:left;text-color:green;clear:both;"><dfn title="Test"></dfn><?=$ViewDate?> // ADD TOOL TIP $EntryDate </div> <? } else { ?> <div style="width:150px;height:4px;padding:10px;text-align:right;float:left;text-color:green;clear:both;"> <a href="StatementEntry.php?ID=<?=$ID?>" title=<?=$AddDate?>> <?=$ViewDate?></a></div> /* 2022-12-20 Missing HH:MM:SS*/ <? } ?> <div style="width:70px;height:4px;padding:10px;color:<?=$colorSelect?>;<?=$x?>text-align:right;float:left;"><?=$input?> </div> <div style="width:70px;height:4px;padding:10px;color:<?=$colorSelect?>;<?=$x?>text-align:right;float:left;"><?=$out?> </div> <div style="width:70px;height:4px;padding:10px;color:<?=$colorSelect?>;<?=$x?>text-align:right;float:left;">£<?=$DisplayCurValue?> </div> <div style="width:100px;height:4px;padding:10px;color:<?=$colorSelect?>;<?=$x?>float:left;"><?=$reason?> </div> <div style="width:250px;height:4px;padding:10px;color:<?=$colorSelect?>;<?=$x?>float:left;"><?=$Comment?> </div> <? } ?> <div style="width:70px;height:1px;padding:10px;float:left;clear:both"> </div> </div> <div style="width:670px;height:50px;padding:0px;float:left;"> <input class="MyButton"type="submit" name="direction" value="Main Menu"> <br> </div> </form> </div> </body> </html> Sorry for the amount of code in the last one. I am not a profesional developer, I grew up with ASP and moved over to .NET but I love using PHP as lynux servers are better. Also the code may not be all to your liking. Just have a quick look and see if you can see anything obviouse. I am mainly interested in th DD and the HH:MM data. is it the space that is causing the problem. If so, I need to convert the $AddDate to DD_HH:MM.
-
No I tried that and it does not work. What I mean by a tool tip is a microsoft tool tip that pops up as a rectangular box of text when the mouse is over it. A kind of help text. This is what I have used kicken's <a href="StatementEntry.php?ID=<?=$ID?>" title="The tooltip here"><?=$ViewDate?></a> This is a part of my website that has been up and running since July 2015. I just thought it would help me. This works fine. All I have added to the link is title="The tooltip here"