39,323 Topics

Member Avatar for
Member Avatar for RC_820

Hello, does anyone here know how to make notifications with websocket + codeigniter4 / php? Example: will display the total of all users who registered today

Member Avatar for Dani
0
71
Member Avatar for RC_820
Member Avatar for Dani
0
500
Member Avatar for borobhaisab

Hello, Was reading this tutorial on the INTVAL(): https://www.w3schools.com/php/phptryit.asp?filename=tryphp_func_var_intval How is this an INT ? $e = array("red", "green", "blue"); echo intval($e) . "<br>"; And, when to use int() function and when to use INTVAL() function and when not to use them ? I am confused!

Member Avatar for Dani
0
54
Member Avatar for borobhaisab

Hello, I have come across these echo types before: echo print_r printf var_dump But now come across: var_export. https://www.w3schools.com/php/phptryit.asp?filename=tryphp_func_var_var_export $a = 32; echo var_export($a) . "<br>"; $b = "Hello world!"; echo var_export($b) . "<br>"; $c = 32.5; echo var_export($c) . "<br>"; $d = array("red", "green", "blue"); echo var_export($d) . "<br>"; …

Member Avatar for Dani
0
17
Member Avatar for borobhaisab

Hello, One of the following code got htmlspecialchars. Which code is correct out of the two ? Both codes build pagination section. Need to add security so users cannot sql inject. Not using http_build_query function here as I want to build a pagination section without it and already built one …

Member Avatar for Dani
0
88
Member Avatar for borobhaisab

Folks, Look at this youtube serp: https://www.youtube.com/results?search_query=make+money+online+in+2022 You are shown 10 search results. Now, if you want to see more results, you got to scroll to the bottom of the page and only then more search results would be presented. Otherwise not. Q1. My question is, what php function or …

Member Avatar for Dani
1
139
Member Avatar for Chloe_6

**I have attached all of the coding needed** I'm using PHP to design a website. The problem that I am facing is that, the button on the add products page isn't taking the inputs and putting them on the products list page. I'm wondering what I can do to get …

Member Avatar for rproffitt
0
142
Member Avatar for ajain.imenso

The benefits of online shopping need no elaboration anymore. Billions of people rely on online shopping service providers across the world. In fact, the e-commerce platforms proved to be saviors for people during the months of lockdown. Developing an online store can be profitable for sure but choosing the right …

0
223
Member Avatar for Dani

Sometimes we have a need to take a simple PHP array and represent it as an encoded string. One use case that we have for this at DaniWeb is when a new user signs up, and we ask them to click on a link that was sent to them via …

Member Avatar for Dani
2
228
Member Avatar for Ant_426

Hi. Please could someone help me understand what's happening here. I have a MySQL database which has a table with some data in the following format: 2022-03-15 06:55:39:<br/>LineOfSight:<br/>java.lang.Exception:<br/> UNAVAILABLE TELEMETRY BR$0 The field collation is utf8 and the data is stored as text. This data is provided via a 3rd …

Member Avatar for Dani
1
384
Member Avatar for Dani

Sometimes we want to know if the webpage was fetched over an SSL connection (e.g. the URL begins with https:// instead of http://). This way, if an end-user is accessing an insecure version of our site, we can redirect them to the secure version. The following PHP function called `no_ssl()` …

2
218
Member Avatar for Dani

For some reason, PHP class constants don't play nicely with inheritance. For example, suppose you have the following code: class Foo { const VAR = 'foo'; public function __construct() { echo self::VAR; } } class Bar extends Foo { const VAR = 'bar'; } // This will actually print out …

Member Avatar for Dani
1
341
Member Avatar for lukwagomedia

Hello everyone! I am wondering how I can access the ending of my url address. For exampel: www.castingvault.eu/willy And I wand the name "willy" only and then process and use it in my php code. Usually you write the url like this: www.castingvault.eu/members.php?mem=willy and the following is how to access …

Member Avatar for Dani
0
290
Member Avatar for rishabs

User interface (UI) design is a process used by designers to create interfaces in software, such as computer devices, that focus on appearance or style. Designers want the interfaces to be easy to use and user-friendly. User interface design covers graphical user interfaces and other forms - such as voice-controlled …

Member Avatar for kasiamizera
2
365
Member Avatar for kondokoroson28
Member Avatar for exploretech
Member Avatar for abu taher

I want to make a pdf file in php. I write code like this: <?php require_once __DIR__ . '/vendor/autoload.php'; include('conn.php'); $res = mysqli_query($conn, "select * from smash"); if (mysqli_num_rows($res) > 0) { $html = '<table>'; $html = '<tr><td>ID</td><td>Name</td><td>FatherName</td><td>Address</td><td>Phone</td><td>Class</td><td>Qualification</td><td>Branch</td><td>rollno</td></tr>'; while ($row = mysqli_fetch_assoc($res)) { $html .= '<tr><td>' . $row['id'] . '</td><td>' …

Member Avatar for mtyide
1
629
Member Avatar for spg_gd

I have a table with the below sample output. uid atime adate A_in_out 11 8:16 14/05/2014 I 11 13:35 14/05/2014 I 11 17:23 14/05/2014 I 11 21:09 14/05/2014 I 12 14:06 14/05/2014 I 12 22:39 14/05/2014 I 13 8:00 14/05/2014 I 13 17:12 14/05/2014 I I want to build a …

Member Avatar for spg_gd
0
162
Member Avatar for Dani

By default, PHP's clone keyword just creates a shallow copy of an object, and doesn't work as desired if the object contains properties that are also objects, because it doesn't create real copies of those objects but rather just pointers to the initial version of them. This function creates a …

0
290
Member Avatar for Dani

A little while ago, I wrote a [tutorial](https://www.daniweb.com/programming/web-development/tutorials/537376/sanitize-php-user-input-strings) about how important it is to sanitize PHP user input strings. Not only is it important to sanitize user input being fed into a database query, but it's also important to sanitize user input being displayed to the end-user to generate valid …

2
264
Member Avatar for Dani

A PHP array is essentially a stack of elements that can be used to denote a list, represent a collection of variables, etc. You can easily use loops to iterate over each element of an array. As PHP is a loosely typed language, all of the elements of an array …

1
134
Member Avatar for Ant_426

Hi. Hoping someone can explain this to me please. $quantity = $_POST['quantity']; echo "<pre> -- quantity -- "; print_r($quantity); echo "</pre>"; This returns: -- quantity --Array ( [0] => [1] => [2] => [3] => 2 [4] => [5] => [6] => ) $selectitem = $_POST['selectitem']; echo "<pre> -- selectitem …

Member Avatar for Amonza
0
166
Member Avatar for Pekja

Can someone enlighten me is there any difference if we use framework or not using framework to build REST API?

Member Avatar for Dani
0
37
Member Avatar for Vmr_574

hello, i hope someone can help me i have a table ip in my database if there is 5 times in it he has to forward it in php to another page. thanks in advance

Member Avatar for Dani
0
297
Member Avatar for Ant_426

Hi. I have a local installation of SQLite3 and PHP which runs a small in house PHP application so sql injection is not an issue. I am able to execute the following: if(isset($_GET['deletequote'])) { $qno = $_GET['deletequote']; echo $qno;?><br><?php // for testing $db = new SQLite3('./fi_data.db') or die('Cannot delete quote. …

Member Avatar for Ant_426
0
494
Member Avatar for dwlamb

I am parsing xml data generated by backup software for SMS and phone logs. Most of the data appears like this: ``` <sms protocol="0" address="##########" date="1495903715000" body="Ok. See you then.;-)" subject="none" ... /> ``` For most bodies of a text message, the data follows the same pattern above: Keyword `body="<string>"`. …

Member Avatar for pritaeas
1
208
Member Avatar for lewashby

I've recently gotten my first ID job as a PHP programmer but one of the tasks that bites my is JS/jQuery, I don't know JS/jQuery but now i'm having to use it. I'm taking a course on udemy.com but I'm having issues, sometimes the code executes and sometimes noting happens …

Member Avatar for Dani
0
268
Member Avatar for Divyansh_5

I am new to PHP and I need some help in the below code. The below code is working fine but I need to add a "Functionality to be added in the below code, so that if any New File is uploaded it should auto increment in a series. For …

Member Avatar for gce517
0
147
Member Avatar for owen_5

Hi I am still learning a lot about PHP but already have an active website where users can click a link and download digital products (we have no user registration). Some users would like to click a link (which I have created already) which will open up a separate window …

Member Avatar for gce517
0
21
Member Avatar for Aisha_sg

hey I'm beginner learning php have hard time to Insert data to product in database with image because the category I did make it work but now I need to update data the same style that I add it with the Insert Code: <?php include('./pro_crud/config.php'); $sql_cat = "SELECT * FROM …

0
246

The End.