explain working of session_start() in php

How the session_start() works in php? When we write session_start() at top of the file, how the things are working in background.If anyone can explain. >Solution : Session in PHP is just a variable that stores value in it. the session_start() is used to tell that we are using session variable in this code and… Read More explain working of session_start() in php

how to increment session variable on every page? php/mysql

i have 2 session variable. first one is an array to store inputs, second one is for checking index number. if(isset($_POST[‘submit’])){ $selected=$_POST[‘check_list’]; foreach ($selected as $c){ $checked[]=$c; } $_SESSION[‘checkedsession’]=$checked; $_SESSION[‘index’]=$index; $index=0; I have 13 pages belongs to items in $checked array. i call the session variables on other pages: $index=$_SESSION[‘index’]; $index=$index+1; $checked=$_SESSION[‘checkedsession’]; now our index… Read More how to increment session variable on every page? php/mysql

continue loop even if one host is not available

import time import paramiko import sys from getpass import getpass #First Unifi AP IP Address firstip=3 fistdigits = ‘10.0.0.’ #how can we prevent from crashing if 10.0.0.19 is not an available device while firstip<=100: host= f'{fistdigits}{firstip}’ #first one will be 10.0.0.3 then 10.0.0.4 etc username="username" password="password" session= paramiko.SSHClient() session.set_missing_host_key_policy(paramiko.AutoAddPolicy()) session.connect(hostname=host, username=username, password=password) #upgradeurl="https://dl.ui.com/unifi/firmware/U7PG2/4.3.13.11253/BZ.qca956x.v4.3.13.11253.200430.1420.bin&quot; #stdin, stdout,… Read More continue loop even if one host is not available

axios data is undefined

I’m trying to perform an axios get request. axios .get("http://10.10.0.145/api/session&quot;, { headers: { ‘Cookie’ : user_cookie } }, ) .then(res => { result = res.data; id_user_intervention = res.data.id; console.log(id_user_intervention); //IS NOT UNDEFINED }) .catch(error => { console.error(error) }) console.log(id_user_intervention); //IS UNDEFINED I need to use id_user_intervention outside the axios request. I assign res.data.id to id_user_intervention,… Read More axios data is undefined

Unable to retrieve multiple values from database

The following data exists in the database: [ { "_id": { "$oid": "628c787de53612aad30021ab" }, "ticker": "EURUSD", "dtyyyymmdd": "20030505", "time": "030000", "open": "1.12161", "high": "1.12209", "low": "1.12161", "close": "1.12209", "vol": "561", "id": 1 }, { "_id": { "$oid": "628c787de53612aad30021ac" }, "ticker": "EURUSD", "dtyyyymmdd": "20030505", "time": "030100", "open": "1.12206", "high": "1.1225", "low": "1.12206", "close": "1.1225", "vol": "1223",… Read More Unable to retrieve multiple values from database