Articles on Trending Technologies

Technical articles with clear explanations and examples

What are the differences between JavaScript and PHP cookies?

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 905 Views

Cookies are text files stored on the client's browser to remember user information across web pages. Both JavaScript and PHP can work with cookies, but they operate differently − JavaScript handles cookies on the client-side while PHP manages them on the server-side. JavaScript Cookies JavaScript cookies are manipulated directly in the browser using the document.cookie property. They're ideal for client-side data storage and immediate user interactions. Setting a Cookie with JavaScript // Set a cookie that expires in 7 days document.cookie = "username=john; expires=" + new Date(Date.now() + 7*24*60*60*1000).toUTCString() + "; path=/"; Reading ...

Read More

How to pass JavaScript variables to PHP?

Johar Ali
Johar Ali
Updated on 15-Mar-2026 21K+ Views

You can pass JavaScript variables to PHP using several methods. Since PHP runs on the server and JavaScript runs in the browser, direct variable passing isn't possible. However, you can achieve this through AJAX requests, form submissions, or by embedding JavaScript values in PHP output. Method 1: Using AJAX POST Request The most common approach is to send JavaScript variables to PHP using AJAX − Pass JS to PHP Send Data to PHP ...

Read More

How to call Python file from within PHP?

SaiKrishna Tavva
SaiKrishna Tavva
Updated on 15-Mar-2026 11K+ Views

In PHP, you can execute Python scripts using built-in functions like shell_exec(), exec(), or proc_open(). Each method offers different levels of control over the process. Using shell_exec() The simplest approach − runs a command via the shell and returns the output as a string. Use escapeshellcmd() to sanitize the command ? The square of 4 is 16 Specifying the Python Interpreter If the script lacks a shebang line (#!/usr/bin/env python3), explicitly call the interpreter ? The square of 5 is 25 ...

Read More

Is there something available in Python like PHP autoloader?

Sumana Challa
Sumana Challa
Updated on 15-Mar-2026 484 Views

No, Python does not have a direct equivalent to PHP's autoloader, and it doesn't need one. The two languages handle module loading fundamentally differently. Why PHP Needs Autoloaders PHP starts a fresh process for each web request, loading all code from scratch every time. Autoloaders optimize this by loading classes only when they are first used, avoiding the cost of loading unnecessary files on every request. Why Python Doesn't Need One Python imports modules once when the application starts. The module stays in memory (sys.modules) for the lifetime of the app. Subsequent requests reuse the already-loaded ...

Read More

How to get the POST values from serializeArray in PHP?

Ricky Barnes
Ricky Barnes
Updated on 15-Mar-2026 3K+ Views

The jQuery serializeArray() method serializes form elements into a JSON array of name-value pairs. When sent via $.post(), PHP receives these values through the $_REQUEST or $_POST superglobal. PHP Backend (serialize.php) This file receives and displays the POST values ? jQuery Frontend (HTML) The form collects user data and sends it using serializeArray() ? $(document).ready(function() { $("#driver").click(function(event) ...

Read More

PHP Soap Client is not supporting WSDL extension while connecting to SAP system

Hayat Azam
Hayat Azam
Updated on 15-Mar-2026 547 Views

When integrating PHP SOAP Client with SAP systems, you may encounter issues with WSDL extensions due to WS-Policy requirements. SAP's policy framework can prevent PHP SOAP clients from properly consuming web services. Here are two solutions to resolve this. Solution 1: Modify Policy Requirements Update the policy tag in your WSDL to make it optional instead of required. Find this line ? Change it to ? Test your PHP SOAP client connection after making this change to verify the service works correctly. Solution 2: Change URL Endpoint ...

Read More

How to access a collection in MongoDB using Python?

Priya Mishra
Priya Mishra
Updated on 15-Mar-2026 1K+ Views

MongoDB is a well-known NoSQL database that offers a scalable and flexible approach to store and retrieve data. Using Python with MongoDB enables developers to interact with database collections effortlessly through the PyMongo library. This article explains how to access a MongoDB collection using Python, covering the required steps, syntax, and techniques for connecting to, querying, and manipulating data. Syntax from pymongo import MongoClient # Connect to MongoDB client = MongoClient('mongodb://localhost:27017/') # Access database and collection db = client.database_name collection = db.collection_name # Perform operations collection.insert_one(document) collection.find(query) collection.update_one(filter, update) collection.delete_one(filter) PyMongo ...

Read More

How to Install & Setup MEAN Stack on Ubuntu (MongoDB, Express.JS, Angular.JS, Node.JS)

Satish Kumar
Satish Kumar
Updated on 15-Mar-2026 1K+ Views

The MEAN stack is a popular web development framework consisting of MongoDB, Express.js, Angular.js, and Node.js. It is an open-source platform that allows developers to create robust web applications quickly and efficiently. In this article, we will guide you through the installation and setup process of the MEAN stack on Ubuntu. Step 1: Install Node.js and NPM Node.js is the runtime environment that allows developers to run JavaScript code outside of the browser. It is the backbone of the MEAN stack. To install Node.js on Ubuntu, follow these steps − Open the terminal on Ubuntu by pressing ...

Read More

How to Use Go With MongoDB?

Sabid Ansari
Sabid Ansari
Updated on 15-Mar-2026 617 Views

MongoDB is a popular NoSQL database that is widely used in modern web applications. Go, on the other hand, is a fast and efficient programming language that is becoming increasingly popular for building web applications. In this article, we will discuss how to use Go with MongoDB, including how to connect to a MongoDB database and how to perform basic CRUD operations. Installing the MongoDB Driver for Go Before we can start using Go with MongoDB, we need to install the MongoDB driver for Go. The easiest way to do this is by using the following command ? ...

Read More

How to restart a NoSQL Database service like MongoDB?

Satish Kumar
Satish Kumar
Updated on 15-Mar-2026 1K+ Views

To restart a MongoDB service, use the systemctl command on modern Linux systems. MongoDB runs as a system service called mongod that can be managed through systemd service management tools. Syntax sudo systemctl restart mongod sudo systemctl status mongod sudo systemctl enable mongod Method 1: Using systemctl (Recommended) Check the current status of MongoDB service ? sudo systemctl status mongod mongod.service - MongoDB Database Server Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: https://docs.mongodb.org/manual Restart ...

Read More
Showing 22761–22770 of 61,297 articles
Advertisements