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>'; ?>

+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
Member Avatar

hi i was set the task to increment a number by x every x seconds and i tried to find some code off the net, but found the subject covered very sparsley so for whoevers benefit ill post the code here hope it helps :) [CODE] <html> <head> <style type="text/css"> div.cont { position: relative; background-image: url(counter.gif); width:160px; height:110px; vertical-align:text-bottom; } div.cont div.ans { position: absolute; bottom: 0px; margin-bottom:15px; margin-left:7px; color:black; font-family: Verdana, Tahoma, Sans-Serif; font-size: 15pt; line-height: normal; } </style> <?php $now = time(); $start = mktime(0, 0, 0, 1, 24, 2007); $carbonsaving =((($now - $start) * 0.0058774) + 130000); …

Member Avatar
+0 forum 9
Member Avatar

Hello all i am a newbie and i would love to learn from you all. Please help me as i am making a project with phpmysqli where i need to approve a pending status! Here's my code. Kindly help me thanks. <?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> …

Member Avatar
+0 forum 1
Member Avatar

Hey i am student and quite inexperienced in coding. Therefore i hope somebody can help me how I can create a Multibar chart. in the appendix I have attached a picture how it should looks like. I tried it for 2 weeks now and I still have no idea. It would be very nice if somebody have an idea how it could work. Thank you in advance

Member Avatar
+1 forum 3
Member Avatar

Signup.php <form name="sign-up" method="post" action="process.php?action=sign-up"> <h3><span>Sign-Up</span></h3> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <thead> User Details </thead> <tr> <th scope="row">*User ID :</th> <td><label for="playerid"></label> <input type="text" name="playerid" id="playerid" required="required"></td> </tr> <tr> <th scope="row">*Name :</th> <td><label for="playername"></label> <input type="text" name="playername" id="playername" required="required"></td> </tr> <tr> <th scope="row">*Mobile Number :</th> <td><label for="playermob"></label> <input type="text" name="playermob" id="playermob" required="required"></td> </tr> <tr> <th scope="row">*E-Mail :</th> <td><label for="playermail"></label> <input type="text" name="playermail" id="playermail" required="required"></td> </tr> <tr> <th scope="row">Address :</th> <td><label for="playeraddress"></label> <textarea name="playeraddress" id="playeraddress" cols="45" rows="5"></textarea></td> </tr> <tr> <th scope="row">&nbsp;</th> <td><input type="submit" name="cancel" id="cancel" value="Cancel"> <input type="submit" name="submit" id="submit" value="Submit"></td> </tr> <tr> <th scope="row">&nbsp;</th> <td>&nbsp;</td> </tr> <tr> <th colspan="2" scope="row">&nbsp;</th> …

Member Avatar
+0 forum 9
Member Avatar

hello, my sign in working fine..but not my logout and signin script...help please. this is my logout script: <?php session_start(); session_unset(); session_destroy(); header("Location: index.php"); and my signin script: <?php if (isset($_POST['login-submit'])) { require 'dbh.inc.php'; $mailuid = $_POST['mailuid']; $password = $_POST['pwd']; if(empty($mailuid) || empty($password)) { header("Location: ../index.php?error=emptyfields"); exit(); } else{ $sql = "SELECT * FROM users WHERE uidUsers=?; "; $stmt = mysqli_stmt_init($conn); if (!mysqli_stmt_prepare($stmt, $sql)) { header("Location: ../index.php?error=sqlerror"); exit(); } else{ mysqli_stmt_bind_param($stmt, "s", $mailuid); mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); if ($row = mysqli_fetch_assoc($result)) { $pwdCheck = password_verify($password, $row['pwdUsers']); if ($pwdCheck == flase) { header("Location: ../index.php?error=wrongpassword"); exit(); } else if($pwdCheck == true) { …

Member Avatar
+0 forum 2
Member Avatar

i have below code and i need to addd close button (x) on popover for each three popovers ,can any one help me how to do this <div class="row"> @*<div class="col-lg-1 popper" title="Note" data_toggle="popover">sdsda*@ <div class="col-lg-1"> <i class="ShowToolTip popper fa fa-eye LabTaskClass28 LabTaskClassforShowHideCol77" title="No task result for note" data_toggle="popover" style="/*! width: 1px !important; */"><span class="close-popover float-right text-danger "></span></i> <div class="popper-content" style="display:none"> <div class="form-group"> <label title="Task name">Task name </label> <input type="text" class="form-control"> <label title="Message"> Message </label> <input type="text" class="form-control" placeholder="Limited to 100 Characters"> <button class="btn-save btn btn-primary btn-sm" style="background-color:maroon !important">Close</button> <button class="btn-save btn btn-primary btn-sm" style="background-color:darkslategrey !important">SAve</button> </div> <button type="submit" class="btn …

Member Avatar
+0 forum 1
Member Avatar

**How to create pdf report in php easily ?**

Member Avatar
+0 forum 9

The End.