Hi all, I am trying to compare data from $_POST['Net'] which has 6 elements to check to see if the data has changed in the form when submitted. Below is the Post array from form. array(16) { ["Submitted"]=> string(4) "true" ["NetValue"]=> string(1) "0" ["ProductID"]=> array(6) { [0]=> string(5) "76458" [1]=> string(5) "76459" [2]=> string(5) "76460" [3]=> string(5) "76461" [4]=> string(5) "76462" [5]=> string(5) "76463" } ["Quantity"]=> array(6) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "2" [3]=> string(1) "1" [4]=> string(1) "1" [5]=> string(1) "1" } ["Nominal"]=> array(6) { [0]=> string(4) "5001" [1]=> string(4) "5001" [2]=> string(4) "5001" [3]=> …

Member Avatar
Member Avatar
+0 forum 5

Hi All, I am trying to get tooltip to work when I hover text in a table. It does work but it produces an extra data table column. If you have any idea how I can stop this, please let me know. Thanks David <script type="text/javascript"> $(document).ready(function(){ $('[data-toggle="tooltip"]').tooltip(); }); </script> <td class="tableBody"><?php echo $rowExceptionReport->POID; ?></td> <td class="tableBody"><?php echo $rowExceptionReport->POProductID; ?></td> <td class="tableBody"><?php echo htmlspecialchars($rowExceptionReport->ExportDate); ?></td> <td class="tableBody"><?php echo htmlspecialchars($rowExceptionReport->Quantity); ?></td> <td class="tableBody"><?php echo htmlspecialchars(substr($rowExceptionReport->Description,0, 100)); ?></td> <td class="tableBody"><?php echo htmlspecialchars($rowExceptionReport->WHLReference);?></td> <td class="tableBody" data-toggle="tooltip" data-placement="top" title="<?php echo $rowExceptionReport->NominalCode?>"><?php echo htmlspecialchars(substr($rowExceptionReport->NominalCode,0,20)); ?>...</td>

Member Avatar
Member Avatar
+0 forum 1

Good afternoon all, The issue I am having is that when POST data values are looped through inside the while loop as each record is compared with the POST data and the database record for any changes. For this test the data from the post is exactly correct. The if statment compares the data and displays this as not eaual when it is? What I can see is happening from what I can see is that the out data when output is not in sync, but not sure how to resolve this example The data output fot the first loop …

Member Avatar
+0 forum 0

Good day to you all, I ham having an issue the the following error (Fatal error: Call to a member function fetch_result() on a non-object in on line 167) which is the while ($row = $result->fetch_object()) every way I try to change this another error crops up. If yo can find the time to assist me, it would be appreciated. Thanks in advance connection page <?php $dbhost = "xxxxx"; $dbuser = "xxxx"; $dbpass = "xxxxxx"; $dbname = "xxx"; $mysqli = new mysqli($dbhost, $dbuser, $dbpass,$dbname) or die ("Error connecting to database"); if ($mysqli->connect_errno){ printf("Connection failed: %s\n", $mysqli->connect_error); exit(); } ?> Index …

Member Avatar
Member Avatar
+0 forum 8

Hi I am trying to redirect a url in the htaccess file. RewriteEngineOn RewriteRule ^wakins.co.uk$ http://www.watkins.co.uk [R=301,L] and I have also tried this RewriteEngineOn RewriteRule ^/wakins.co.uk$ http://www.watkins.co.uk [R=301,L] Thanks in advance D

Member Avatar
Member Avatar
+0 forum 1

Hi all, I am trying to compare output from DB The code below works on 1 check, but I require to do this on multiple products like so `if rowProduct("GRPCODE") <> "Cross Hire" or rowProduct("GRPCODE") <> "Boiler Ancillaries" then` etc but the above line does not work as I have coded it? What is the problem with the code. Thanks in advance if rowProduct("GRPCODE") <> "Cross Hire" then ' Elimination unwanted code if not rowStock.eof then ' stock found do while not rowStock.eof ' loop through stocl if instr(RemoveItems, "," & rowStock("ITEMNO") & ",") = 0 then ' item not …

Member Avatar
Member Avatar
+0 forum 1

Hi All, I am currently trying to update a check box . Then pass the data back through the same page and if set update DB. The code is long so I shall be as concise as possible. I have pulled the data from the DB and I am using a check box to submit and test if checkbox has been submitted using isset $_POST on checkbox. I have also used debug on GET and REQUEST and I am not sure why it does not work. Any assistance would be appreciated. Thanks in advance <?php if (isset($_POST['checkbox'])){ echo "SET";// udate …

Member Avatar
Member Avatar
+0 forum 9

Hi I am trying to convert the following mysql function to mysqli. Thanks in advance David <?php /*------------------------------------------------- This class contains generic database functions to view, add, edit and delete all facets of a database -------------------------------------------------*/ require_once ("sitesettings.php"); class Database extends SiteSettings { var $Query; var $Connection; function Database() { $Settings = SiteSettings::SettingValues(); $Hostname = $Settings['DB-Hostname']; $Username = $Settings['DB-Username']; $Password = $Settings['DB-Password']; $Database = $Settings['DB-Database']; $this->Connection = mysql_connect($Hostname, $Username, $Password); mysql_select_db($Database); register_shutdown_function(array(&$this, "close")); } function Execute($SQL) { $this->Query = $SQL; return mysql_query($SQL, $this->Connection); } function Records($SQL) { return mysql_fetch_array($SQL); } function RecordCount($SQL) { return mysql_num_rows($SQL); } function Close() { mysql_close($this->Connection); …

Member Avatar
Member Avatar
+0 forum 3

The following code is producing this error `Microsoft VBScript compilation error 800a03f6 Expected End ` followed by `/stock/availability-quick/availability2.asp, line 130` I think it is a if else error. I have looked over the code and i don't see the error and would benefit from an expert pair of eyes to look over it. Thanks in advance David <%@LANGUAGE="VBSCRIPT"%> <!--#include file="../../includes/functions/insphire.asp"--> <!--#include file="../../includes/functions/logaccess.asp"--> <!--#include file="../../includes/functions/stock.asp"--> <% if request("Allow") = "f875eba08594178509bd3482dc0294" then ' security check passed %> <!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" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Administration - Stock - Status</title> </head> <body> …

Member Avatar
+0 forum 0

Hi All, I am tring to capture the data being passed from an ASP page. `<td height="30"><a href="http://admin.boilerrentalservices.co.uk/availability.php?<%= rowProduct("GRPCODE") %>"><%= rowProduct("GRPCODE") %></a></td>` using VAR_DUMP($_GET) in the PHP page which produces this `array(1) { ["AHU-100-200"]=> string(0) "" }` How can I extract this 'AHU-100-200' data in a usable form and use to search a Database. Thanks in advance David

Member Avatar
Member Avatar
+0 forum 1

Hi All, I am a new user to ASP and would like to add a to an accumalted value. The value stored in QTYALLOC can be a 1 or a 2 but currently the code will only add increment by 1, but what I am trying to do is increment by the value of QTYALLOC. I had placed order in the increment counter (StockAllocate + 1) like so (StockAllocate + 1) but this did not seem to work. My syntax mak not be correct. What I have tried is not working. Any assistance would be appriciated. if rowStock("QTYALLOC") <> "0" …

Member Avatar
Member Avatar
+0 forum 4

Hi all, I am looking to extract address line of text into arrays in a word document. I am only really looking for the postcode to extract. Any help would be appreciated Thanks David Velta - The Underfloor Heating Company, Wombwell School, S73 8AX Speedy Asset Services Limited, C/O Arnold Clark, CW9 5GG Owen Brown Limited, Metal & Wood Shop, DE74 2NL Getrag Ford Transmission, Britain, Off Speke Boulevard, L24 9LE PDM Ltd, Stoke Lane, NG14 5HJ Robert Kirkland (Blyth) Ltd, Belsay Close, NE61 6XG MCS Ltd, C/O Carillion Advanced Works Project, BS10 5NB MCS Ltd, C/O Carillion Advanced Works …

Member Avatar
Member Avatar
+0 forum 6

Hi all, I have to update some classic ASP code and I need to add an if statment to compare if a uppercase value is == "N/A" and to compare value with request("productLink") line 8 and if it is it should by pass validation on line 16. Any further information required please let me know Thanks in advance David <%@LANGUAGE="VBSCRIPT"%> <!--#include file="../../includes/functions/insphire.asp"--> <!--#include file="../../includes/functions/stock.asp"--> <!--#include file="../../includes/functions/logaccess.asp"--> <% if request("Allow") = "f875eba085941cc78509bd3482dc0294" then ' security check passed categorycodeSQL = "SELECT StockExpectedCategoryCode FROM StockExpectedCategories WHERE StockExpectedCategoryProductID = '" & replace(request("ProductLink"), "heaters", "heater") & "'" set rowCategoryCode = returnrecordsetstock(categorycodeSQL) if not rowCategoryCode.eof then …

Member Avatar
Member Avatar
+0 forum 3

Hi All I am trying to find out the best way to capture the var_dump($contents) on line 29. I am think array? but I don't know how many string elements the array is returning. This is the output via var_dump($contents); array (size=45) 0 => string '.' (length=1) 1 => string '..' (length=2) 2 => string 'logs' (length=4) 3 => string 'index.html' (length=10) 4 => string 'executable' (length=10) 5 => string 'watkinshire' (length=11) 6 => string '.bash_history' (length=13) 7 => string 'beaumont_hire' (length=13) 8 => string 'aircon_london' (length=13) 9 => string 'aircon_london_test' (length=18) 10 => string '.htpasswd' (length=9) 11 => string …

Member Avatar
Member Avatar
+0 forum 3

Hi All, I am trying to connect to a Network drive remotely using authentication data(\\drive_name)(T:). I will need to upload and download documents. If possible can you give me some pointers. If you require any additional information please let me know Thanks in advance David

Member Avatar
Member Avatar
+0 forum 9

Hi All, I am getting an undefined error in the following code Undefined variable: Settings in C:\wamp\www\sessions\index.php on line 14(last line) Any help would be appreciated Thanks in advance David class SiteSettings { var $Settings; function SettingValues() { $Settings['WS-Filepath'] = "/wamp/crud/view.php/"; $Settings['WS-HTTPpath'] = "http://localhost/crud/view.php/"; $Settings['DB-Hostname'] = "localhost"; $Settings['DB-Username'] = "root"; $Settings['DB-Password'] = ""; $Settings['DB-Database'] = "db301847341"; return $Settings; } } header("Location: " . $Settings['WS-HTTPpath']);

Member Avatar
Member Avatar
+0 forum 21

Hi I am having a problem with the user ID being set, resulting in not deleting the chosen record. This is the data being passed in the url from view.php - delete.php http://localhost/crud/delete.php?91 . I have put in an if statement to check if the UserID is set and it fails. Any help would be appriciated Thanks David page view.php <?php include('include/db.php'); if ($result = $mysqli->query("select * FROM users ORDER BY UserID")){ if ($result->num_rows >0){ echo"<table border='0' cellpadding='10'>"; echo "<tr><th>ID</th><th>Name</th><th>User Email</th><th>Update</th><th>Delete</th></tr>"; while($row = $result->fetch_object()) { echo "<tr>"; echo "<td>" . $row->UserID . "</td>"; echo "<td>" . $row->UserFullname . "</td>"; echo …

Member Avatar
Member Avatar
+0 forum 4

Hi All, I am trying to add insert/update and delete to an OOP singleton database connection using public functions like this, not sure if it is correct? example code public function insert($sql){ if($this->_execute= $this->_mysqli->_execute($sql)){ while ($row = $this->_execute->fetch_object()){ $this->_results[] = $row; } $this->_count = $this->_execute->num_rows; } return $this; } //page index.php <?php require_once 'classes/db.php'; function Users(){ $users = DB::getInstance()->query('SELECT UserID, UserFullName, UserEmail, UserLastPassword, UserName, UserActive FROM Users'); if ($users->count()){ foreach ($users->results() as $user){ echo $user->UserName, $user->UserActive,$user->UserLastPassword,'<br />'; } } } Users(); //page db.php <?php class DB { private $_mysqli, $_query, $_results = array(), $_count=0, $_last_id = -1; public static $instance; …

Member Avatar
Member Avatar
+0 forum 17

Hi All, I have been using a latest version of wamp daily for the last month on this PC and suddenly over the weekend it has stopped working. I have tried the following: I have restarted all services a number of times. Restored back to earlier point on Friday when known working. The Wamp icon is green I can access PHPMyadmin Wamp states server is online Using long code structure <?php ?> Using correct extention no skype Now I don't know why this has happend Thanks in advance David

Member Avatar
Member Avatar
+0 forum 3

Hi All, I am trying to connect to a database OOP singleton method. I am getting an error "syntax error, unexpected 'function_construct'" and I unable to find the syntax error in the code. Any help with this would be appreciated. Thanks in advance David // Page: index.php <?php require_once 'classes/db.php'; echo '<pre>', print_r(DB::getInstance()->query('SELECT * FROM Users')->results()), '</pre>'; //classes/db.php <?php //classes/db.php class DB { private $_mysqli, $_query, $_results = array(), $_count=0; public static $instance; public static function getInstance(){ if (isset(self::$instance)){ self::$instance = new DB(); } return self::$instance; } public function_construct(){ $this->_mysqli = new mysqli('localhost','xxxx','xxxxx','db301847341'); if($this->_mysqli->connect_error) { die($this->_mysqli->connect_error); } } public function …

Member Avatar
Member Avatar
+0 forum 5

Hi all, I am trying to connect to a remote server, I am using the IP address server name and folder to connect, not sure if ths is working? I am aslo getting an error on the final foreach loop (`foreach ($files as $file) {//print array`) Warning: Invalid argument supplied for foreach() in C:\wamp\www\open_dir\index.php on line 50. Any help would be received would be appriciated Thanks in advance David function filelist ($startdir="./http://IPaddress/WATKINS-TS\Webserv/", $searchSubdirs=1, $directoriesonly=0, $maxlevel="all", $level=1) { //list the directory/file names that you want to ignore $ignoredDirectory[] = "."; $ignoredDirectory[] = ".."; $ignoredDirectory[] = "_vti_cnf"; global $directorylist; //initialize global array …

Member Avatar
Member Avatar
+0 forum 6

Hi all, I am trying output the following 1 user after validating data from a database and I have no output to the screen. I am not sure what is missing from query? Any help would be appreciated Thanks in advance David ------- Index.php ------ <?php session_start(); ob_start(); include_once ("includes/settings.php"); include("includes/functions/functions.php"); $Errors = ""; $_SESSION['LoggedIn'] = false; $_SESSION['UserID'] = ""; $_SESSION['UserAdmin'] = false; if ($_POST['Submitted'] == "true") { // process submitted data $userSQL = $Database->Execute("SELECT UserID, UserFullname, UserEmail, UserLastPassword FROM Users WHERE UserName = '" . mysql_real_escape_string($Text->ValidSQLString($_POST['Username'])) . "' AND UserPassword = '" . md5($_POST['Password']) . "' AND UserActive = …

Member Avatar
Member Avatar
+0 forum 12

Hi All having a problem with the following statement " Notice: Undefined index: Username in C:\wamp\www\david\remoteaccess\index.php on line 6". I have tried defining Username in a number of ways, but I seem to missing something. Any help would be great Thanks in advance Thanks <?php session_start(); include("includes/utilities.php"); include("includes/functions.php"); $username = $_POST['Username']; var_dump($_POST); $Errors = ""; $_SESSION['LoggedIn'] = false; $_SESSION['UserID'] = ""; $_SESSION['UserAdmin'] = false; $_SESSION['Username'] = $username; if (isset($_POST["Username"])) { SQLUser(); }else{ loginForm(); } ?>

Member Avatar
Member Avatar
+0 forum 8

Hi all, I am working on the following code and I am having a problem with defined variables. On the output on the Submitted and Username Inputs as being undefined. I have added $username = (isset($_POST['Username'])) ? $_POST['Username'] : ""; at the start of the function but not suppressed. Thanks for your help David index.php <?php session_start(); ob_start(); include_once ("includes/settings.php"); include("includes/functions/functions.php"); //include_once ("includes/optional.php"); var_dump($_POST); $Errors = ""; $_SESSION['LoggedIn'] = false; $_SESSION['UserID'] = ""; $_SESSION['UserAdmin'] = false; if ($_POST['Submitted'] == "true") { // process submitted data $userSQL = $Database->Execute("SELECT UserID, UserFullname, UserEmail, UserLastPassword FROM Users WHERE UserName = '" . mysql_real_escape_string($Text->ValidSQLString($_POST['Username'])) …

Member Avatar
Member Avatar
+0 forum 8

Hi all, I am working on the following code. In the SQL query, I am currently calling all the data from the DB using * and all works fine. I would like to be selective and call the coloumns required i.e UserID, UserFullName, UserEmail, UserLastPassword, but when I do this I get an Undefined index: UserName in C:\wamp\www\david\access\includes\functions.php on line 23 and Undefined index: UserActive in C:\wamp\www\david\access\includes\functions.php on line 24. Which relates to the echo statments. I am baffled why this doesn't work as the data is called from the DB? Thanks in advance David index page <?php session_start(); ob_start(); …

Member Avatar
Member Avatar
+0 forum 2

Hi all I am trying to call a simple function and I keep getting an error "Parse error: syntax error, unexpected ';', expecting '{' in C:\wamp\www\david\remoteaccess\index.php on line 15" This relates to the call and I don't understand why it does not work. I am using WAMP if that makes any difference. Thanks in advance David ` <?php //session_start(); //include("includes/utilities.php"); //$Errors = ""; // $_SESSION['LoggedIn'] = false; // $_SESSION['UserID'] = ""; // $_SESSION['UserAdmin'] = false; function hello() { print "<h1>HELLO!</h1>"; print "<p>Welcome to my web site</p>"; } function hello(); ?> `

Member Avatar
Member Avatar
+0 forum 4

Hi All, I am trying to the following: The code is written in ASP, the output is from a database. I am trying to multiply the QTY and RATE#2 and display total with each order in the returned data. This relates to the last td's in the output. I also want to data to 2 decimal places(currancy) Anything else required please let me know Thanks in advance David <tr> <td height="30"><a href="/dashboard-fullscreen/individual/contracts/view.asp?Allow=f875eba085941cc78509bd3482dc0294&amp;Contract=<%= rowCrossHire("CONTNO") %>" target="_blank" title="View <%= rowCrossHire("CONTNO") %>"><%= rowCrossHire("CONTNO") %></a></td> <td height="30"><%= sonNo %></td> <td height="30"><%= rowCrossHire("ACCTNAME") %></td> <td height="30"><%= rowCrossHire("ITEMNO") %></td> <td height="30"><%= itemDescription %></td> <td align="center" height="30"><%= …

Member Avatar
Member Avatar
+0 forum 10

Hi All I am running an sql query to obtain the data for $CaseStudyTitle[] = $row['CaseStudyTitle']; located in the while loop and passed as parameters to the fucntion below. Currently I am displaying only one case study title at anytime. The partner can have many case studies titles how can I display all case study titles for each partner this in the function. If you have any question please don't hesitate to reply Thanks in advance D while($row = mysql_fetch_array($result)) { $partners_id[]= $row['web_customised_partners_id']; $image_value[] = $row['image_id']; $image_filename_value[] = $row['image_filename']; $description_value[] = $row['description']; $url_value[] = $row['url']; $case_study_id[] = $row['web_customised_partners_case_study_id']; $CaseStudyTitle[] = …

Member Avatar
Member Avatar
+0 forum 12

Hi All - I am trying create classes for db connection and I am getting the following error Thanks in advance D Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'XXXXXXX_david'@'localhost' (using password: YES) in /home/djenning/public_html/dbconnection/connection.php on line 20 Cannot connect to the database page: connection.php <?php class createConnection //create a class for make connection { var $host="localhost"; var $username="xxxxxxx_david"; // specify the sever details for mysql var $password="XXXXXXXX"; var $database="databaseclass"; var $myconn; function connectToDatabase() // create a function for connect database { $conn= mysql_connect($this->host,$this->username,$this->password); if(!$conn)// testing the connection { die ("Cannot connect to the database"); } else { $this->myconn = …

Member Avatar
Member Avatar
+0 forum 22

Hi all I am experiencing the following error. Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean givenit refers to line 94 which is the while loop start point. Thanks in advance D <?php $x=0; $remainder=0; $image_value = array(); $partners_id = array(); $description_value = array(); $url_value= array(); $image_filename_value = array(); $case_study_id = array(); $CaseStudyTitle = array(); $active = array(); $show_in_banner = array(); while($row = mysql_fetch_array($result)) { //echo $row{'web_customised_partners_id'}; $partners_id[]= $row['web_customised_partners_id']; $image_value[] = $row['image_id']; $image_filename_value[] = $row['image_filename']; $description_value[] = $row['description']; $url_value[] = $row['url']; $case_study_id[] = $row['web_customised_partners_case_study_id']; $CaseStudyTitle[] = $row['CaseStudyTitle']; $active[] = $row['active']; $show_in_banner[]=$row['show_in_banner']; }

Member Avatar
Member Avatar
+0 forum 9

The End.