Member Avatar

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in F:\xampp\htdocs\ajax\server.php on line 55 // Retrieve comments from database $sql = "SELECT * FROM comments"; $result = mysqli_query($conn, $sql); $comments = '<div id="display_area">'; while ($row = mysqli_fetch_array($result)) { $comments .= '<div class="comment_box"> <span class="delete" data-id="' . $row['id'] . '" >delete</span> <span class="edit" data-id="' . $row['id'] . '">edit</span> <div class="display_name">'. $row['name'] .'</div> <div class="comment_text">'. $row['comment'] .'</div> </div>'; } $comments .= '</div>'; ?>

Member Avatar
+0 forum 1
Member Avatar

Hi, I am completing the checkout process on my shopping cart and am sending the payment details to my bank. I have sorted out all of the Cross Origin stuff and I'm receiving the expected resonse to my Payment form POST and puuting it into an iFrame (via forms target=responseiframe). My documentation says I will receive will receive an XML response: <?xml version="1.0"?> <response CUSTOMERID="999" AMOUNT="999" STATUS="999" ERROR="999" ></response> I can see via the browser inspector the document exists. <iframe src="" name="responseiframe" id="responseiframe"> #document <response CUSTOMERID="999" AMOUNT="999" STATUS="999" ERROR="999"> </response> </iframe> My question is, how do I access the document …

Member Avatar
+0 forum 3
Member Avatar

<html> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org"> <script type="text/javascript"> function person(name, age) { this.name = name; this.age = age; } var bucky = new person ("Bucky Roberts, 24"); var Taylor = new person (Taylor Swift, 20"); </script> </head> <body> <script type = "text/javascript"> document.write(taylor.age); </script> </body> </html>

Member Avatar
+0 forum 4
Member Avatar

[Click Here](https://vimeo.com/user108943040/review/393412654/65b9768044) I have attached a vimeo to the issue, the main issue is that google maps seems to be sluggish and not well tracking and slow. Has anyone got any sugestions? Thanks

Member Avatar
+0 forum 2
Member Avatar

Hello i want to upload an audio file(.mp3). The file is uploaded on the folder, the value is inserted on the db (MySql) so far so good. But when i try to play the file on the uploads folder is says its corrupted or extension is wrong.the value is not base64 is the original name of the file html <form [formGroup]="form" (ngSubmit)="onSubmit()"> <input type="file" name="avatar" (change)="onFileSelect($event)" /> <button type="submit">Upload</button> </form> ts onSubmit() { const formData = new FormData(); formData.append('avatar', this.form.get('avatar').value); this.group_id = 0; this.media.tags = this.hashes; this.media.audio = formData; this.media.browser = true; this.userData.uploadAudio(this.media, this.group_id ).subscribe( (res) => { this.uploadResponse = …

+0 forum 0
Member Avatar

hi good day guys, i'm having a trouble with fetching the data i have a list of folder outside like in the picture below ![p1.png](/attachments/large/4/c49da0c2676b0f2d0f5d9acb7afc68bd.png) when i click the first folder the picture below shows the output it has duplicates ![p2.png](/attachments/large/4/9e1c201e5a2edfed6e83663b41116db6.png) i want to know what's the problem with my code why it duplicates the folders. can someone help me out. please... thank you in advance here's my code ![c2.png](/attachments/large/4/5bdfa3d4496764c67c4a61192d59de0d.png) ![c1.png](/attachments/large/4/6d5667c4f98cdcdd9487afb945c6278d.png)

+1 forum 0
Member Avatar

in javascript I got two dates. How to find the difference between two dates. var first = document.getElemetById("first_date").value; var last = document.getElemetById("last_date").value; the date format is mm/dd/yyyy(07/19/2015); how to find?

Member Avatar
+0 forum 4
Member Avatar

I've been working on a project using Morris JS and since there was no solution out there for the Y axis scaling that I could find I wanted to posted where I got. Note you will need [morris JS](https://morrisjs.github.io/morris.js/) & [Moment JS](https://momentjs.com/) to run it. You just need a div with the id "home_chart_0" and it should run. It rounds the max value up, compares it to the min value rounded down and divides it by 10 and spreads over 10 lines. The properties "yLabelFormat" & "numLines" in Morris JS are not documented but exist. Let me know if you …

+0 forum 0
Member Avatar

Does anybody know how i can connect a PHP web site to an OpenEdge Progress Database. I have the following as a connection file that when I run it does not error but there is also nothing to say it has connected either. I have System DSN 32bit ODBC connection call Live_Vision that I am calling. <? if ($conn_id=odbc_connect("Live_Vision","vision","vision", SQL_CUR_USE_ODBC)){ echo "connected to DSN"; if($result=odbc_do($conn_id, $sql)) { } else { echo "can not execute '$sql' "; } echo "closing connection $conn_id"; odbc_close($conn_id); } else { echo " can not connect to DSN"; } ?>

Member Avatar
+0 forum 1
Member Avatar

how to play multiple video in hero image without any delay ?

Member Avatar
+0 forum 1
Member Avatar

My question is this: I'm trying to practice PHP. I use OpenElement as my editor. You can get to know this program through this website: https://www.openelement.com/ Problem is: when I preview the page (with PHP in it) it doesn't display text produced by PHP, but instead it produces the PHP code itself. Do you know OpenElement, and if you know it, do you know how to make it run PHP the way PHP should ben run? Thanks, Leon (joh)

Member Avatar
+0 forum 4
Member Avatar

I have a Google map and a image lightbox slide show in the same page. After the page loads, the images and the map get loaded. map works normal. After I click on the image to make it bigger (lightbox) and then exit, the map is froozed and iresponsive. here is a link to a fiddle sample of it: https://jsfiddle.net/elamigosam/jd2hwfcr/61/ I was thinking to renaming all the functions, but not sure if that would do anything. also no errors in chrome console, and all the files load ok. P.S. I am not a javascript programer, but do understand basics.

+0 forum 0
Member Avatar

here is my table data.. here is my table data.. (4 Columns/1row in mysql table) id bno date results 310 001 02-15-2020 MI,108.53 Oh,194.57 PA,182.22 WA,238.57 How to split(statemiles) single column into (state, Miles) two columns and output like following 5 columns /4rows in mysql using php code. (5 Columns in mysql table) ------------------------------------------------------------------------------------ id bno date result1 result2 310 001 02-15-2020 MI 108.53 310 001 02-15-2020 Oh 194.57 310 001 02-15-2020 PA 182.22 310 001 02-15-2020 WA 238.57 --------------------- Following php code split two columns perfectly.. (screenshot below) ![separated_columns.jpg](/attachments/large/4/4bd9979bc3fb873826711f30f1a64c03.jpg) <?php //invoice.php include('../includes/config.php'); if(isset($_POST["add"])) { $order_no=$_POST['order_no']; $comma = preg_replace('/,\\s*/', "', …

+0 forum 0
Member Avatar

Hi, quick question as I was wondering if I could setup PHPMailer and Sendmail both on the same Apache server? Wasn't sure if Apache would only allow one? Thanks in advance

Member Avatar
+0 forum 1
Member Avatar

I'm trying to use CSS as so: <link rel="stylesheet" media="screen and (max-width: 991.98px)" href="/files/mobile_css/daniweb.css" type="text/css"> <link rel="stylesheet" media="screen and (min-width: 992px)" href="/files/css/daniweb.css" type="text/css"> I want to load one CSS file for our mobile layout and a different one for our desktop layout. The problem is the web browser always downloads both files, which completely eliminates the performance advantages of having a more lightweight mobile CSS. What I'm thinking of doing is using a `<link rel>` to download all of the CSS that's common between mobile and desktop. Then, conditionally, via javascript, injecting CSS via @import (I guess?) to load the …

Member Avatar
+3 forum 16
Member Avatar

Hello, i have the following code: index.php <form role="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <label for="products">Product</label> <select id="products" name="products" class="user"> <?php require 'data.php'; $products = loadProducts(); foreach ($products as $product) { echo "<option id='".$product['id']."' value='".$product['id']."' selected>".$product['name']."</option>"; } ?> </select> <label for="bundles">Bundle</label> <select id="bundles" name="bundles"> </select> </form> Script <script type="text/javascript"> $(document).ready(function(){ $("#products").change(function(){ var aid = $("#products").val(); $.ajax({ url: 'data.php', method: 'post', data: 'aid=' + aid }).done(function(bundles){ console.log(bundles); bundles = JSON.parse(bundles); $('#bundles').empty(); bundles.forEach(function(bundle){ $('#bundles').append('<option>' + bundle.name + '</option>') }) }) }) }) </script> data.php <?php require 'DbConnect.php'; if(isset($_POST['aid'])) { $db = new DbConnect; $conn = $db->connect(); $stmt = $conn->prepare("SELECT * FROM bundles …

+0 forum 0
Member Avatar

problem How to make row that have different value with color red font to full row ? I have html dynamic table not static meaning i dont know how many rows or column inside table because it changed based on data show from back end . I need to give color red to row have distinct value according to my case then second row and third row will be have font red and first row will not be change color . First row have similar value as 12 on all td so that color will not change . But second …

Member Avatar
+0 forum 1
Member Avatar

I have always known that urlencode() encodes spaces as plus signs and rawurlencode encodes spaces as %20. However, I always struggled to know when to use which. I just finally learned today that you should use rawurlencode() if encoding URI paths and urlencode() if encoding query strings. Who woulda thunk it would be that simple?! :-P

+1 forum 0
Member Avatar

A client would like me to implement spreadsheet-style form traversal using the arrow keys on a keyboard, i.e. left arrow would submit the entry for that field and then move left by one field on the form. The form is managed by my PHP code. Does anyone have a [U]browser-independent[/U] method of doing this please? All input fields in the form are single line text fields.

Member Avatar
+0 forum 4
Member Avatar

I am using Magento (Ver 1.9.x) If i try with my localhost success url like, http://192.168.1.65/magento/index.php/checkout/onepage/success/ and return success message with order id. if i try with live, success url like, https://abc.in/payubiz/redirect/success/ success page like blank page. How to solve the issue? Code : https://github.com/ZusZus/Payubiz

Member Avatar
+0 forum 3
Member Avatar

I have a basic html here, where you could just submit the button through an action page, so it inserts the record into the mysql database in phpmyadmin, what I want to know is how to make it auto submit after 5 mins, while setting the blanks fields value into "0" in the database. I am currently using wamp as my local server. Is there a best way how to do this? like using javascript or ajax? this is the html code <h2><font size="6s">GHS Applicant Assessment Tool</font></h2> <h5><font size="5s"><p>This exam is an assessment tool to help us place you in …

+0 forum 0
Member Avatar

I have a large database of information of characters This contains "owner", "charactername" & a lot more info the owner can easily repeat as they own more then one character. what I'm trying to attempt to figure out how to do is create a list of UNIQUE names and how many times they are listed to own characters example NAME | NUMBER OWNED jane | 5 john | 21 michael | 15 etc. I have a script that queries the database and echos a list but I am unsure how to make that echo query the distinct 'owner' to count …

Member Avatar
+0 forum 11
Member Avatar

Our CSS and JS files are not being re-downloaded by web browsers when we update them. The response headers look like this: cache-control: max-age=7776000 content-encoding: gzip content-type: text/css; charset=UTF-8 date: Sat, 01 Feb 2020 02:41:59 GMT etag: W/"5e34c19d-68a08" expires: Fri, 01 May 2020 02:41:59 GMT last-modified: Sat, 01 Feb 2020 00:09:01 GMT server: nginx/1.16.1 status: 200 vary: Accept-Encoding We want web browsers to cache them for 3 months, but we want them to expire the cache prematurely if the files have been modified. Shouldn't the ETag modify itself when the files are updated, and therefore when the Etag is different …

+0 forum 0
Member Avatar

I am still learning PHP and was wondering so don't shoot me down and was wondering why I would get the following error message? 2020-02-01 16:11:14 Error: [InvalidArgumentException] Invalid data type, must be an array or \ArrayAccess instance. Request URL: /auth/signin Referer URL: https://urlsize.com/auth/signup Which then returns "Error: An Internal Error Has Occurred." to the user. The code which I believe is at fault is: public function signin() { if ($this->Auth->user('id')) { return $this->redirect('/'); } $user = $this->Users->newEntity(); $this->set('user', $user); if ($this->request->is('post') || $this->request->query('provider')) { $user = $this->Auth->identify(); if ($user) { $this->Auth->setUser($user); $_SESSION['Auth']['domains_auth'] = 'none'; $multi_domains = get_all_multi_domains_list(); $main_domain = …

Member Avatar
+0 forum 3
Member Avatar

Google PageSpeed Insights indicates a score of 90+. However, the same pages still fall into the slow speed category in Google Search Console Chrome UX report. It says FCP is longer than 3 seconds (3.1s average). What is some low hanging fruit I can do to help real world performance? We serve static content via a cookieless subdomain but using a third-party CDN is cost-prohibitive.

Member Avatar
+0 forum 4
Member Avatar

Hi. Google Search Console inform us like this: Referenced AMP URL is not an AMP We do not know what that information is. Can please anyone help? My website is https://adventurejourney.vn/ Thank you in advance for your help! Adventure Journey Team!

Member Avatar
+0 forum 1
Member Avatar

Can anyone suggest me which one is a better platform for e commerce website development?

Member Avatar
+6 forum 21
Member Avatar

<a style="position:absolute;" href='/Superuser/Plantincharge/dashboard.php'>Back</a> <h4 style="position: relative; left:95%;"> <button onclick="myFunction()">Print</button> <script> function myFunction() { window.print(); } </script> </h4> <h3 style="text-align:center; font-family: sans-serif; border-radius: 25px; border: 2px solid #73AD21; padding: 5px; width: 200px; height: 25px; position:relative; left:500px; overflow: hidden;">PROPOSAL No.</h3> <?php //////////////////////////////////////////// // Collecting data from query string $id=$_GET['id']; // Checking data it is a number or not if(!is_numeric($id)){ echo "Data Error"; exit; } // MySQL connection string require "dbconfig.php"; $count="SELECT * FROM createnearmiss where id=?"; if($stmt = $connection->prepare($count)){ $stmt->bind_param('i',$id); $stmt->execute(); $result = $stmt->get_result(); $row=$result->fetch_object(); echo "<table>"; echo " <table> <tr> <th>Details :</th> <td>$row->details</td> </tr> <tr> <th>Location :</th> <td>$row->location</td> </tr> <tr> <th>Date …

+0 forum 0
Member Avatar

How to insert data in sql server 2012 express using php pdo in wamp server 3? What connection string I need to use to connect in the database?

Member Avatar
+0 forum 3
Member Avatar

I used similar process for users to update username and email, but password is giving me a headache <?php if(isset($_SESSION['id'])){ if(isset($_POST['change_password_submit'])){ $usersId = $_SESSION['id']; include 'includes/dbh.inc.php';//connection to database $currentpassword = $_POST['currentpassword']; $newpassword = $_POST['newpassword']; $newpasswordagain = $_POST['newpasswordagain']; $currentHash = password_hash($currentpassword,PASSWORD_DEFAULT); $newHash = password_hash($newpassword,PASSWORD_DEFAULT); if(empty($currentpassword)){ echo '<p id="sorry">Please enter your current password</p>'; } if(empty($newpassword)){ echo '<p id="sorry">Choose a new password!</p>'; } if(strlen($newpassword)<6){ echo '<p id="sorry">Password cannot be less than 6 characters!</p>'; } if(!preg_match("#[0-9]+#",$newpassword)){ echo '<p id="sorry">Password should have at least one number!</p>'; } if(!preg_match("#[A-Z]+#",$newpassword)){ echo '<p id="sorry">Password should have at least one UpperCase letter!</p>'; } if(!preg_match("#[\W]+#",$newpassword)){ echo '<p id="sorry">Password must have …

Member Avatar
+0 forum 5

The End.