1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jeka94
3 years ago
6

What code do I have to use in my php if i don’t want my $_SESSION[“variablex”] to destroy? But i already have a session_destroy(

) above the code that needs to be there. Or maybe there is an alternative?
So i want to destroy all my sessions EXCEPT $_SESSION[“variablex”]
Computers and Technology
1 answer:
Vesnalui [34]3 years ago
5 0

Answer:

See Explanation Below

Explanation:

Follow the steps below.

1. Start Session

2. Assign the session you want to preserve ( $_SESSION['variablex'] ) to a variable

3. Destroy all session (including the one you want, $_SESSION['variablex'])

4. Reassign the contents of the variable you created in (1) above to $_SESSION['variablex'].

The code is as follows (comments explain each line)

<?php

session_start(); // Start session

$variable = $_SESSION['variablex'] ; // assign $_SESSION['variablex'] to $variable

session_destroy(); // Destroy sessions

$_SESSION['variablex'] = $variable; // assign $variable back to $_SESSION['variablex'] to

// You can continue your code (if you have any), here

// End of solution

?>

You might be interested in
Word processing software, spreadsheet software, database software, and presentation software are examples of what category of co
inysia [295]
<span>b. Application software 

Applications are type of software that are installed in a specific operating system of a computer that deviates from those system software installed together with the system itself. These third-party applications are necessary for other functions such as entertainment, business, leisure and other needs addressing of which the system software can't provide.

Examples:
Microsoft Office Word, Excel, Powerpoint</span>
8 0
3 years ago
Write the definition of a function that takes as input three numbers. The function returns true if the floor of the product of t
SVETLANKA909090 [29]

Answer:

Written in C++

bool checkfloor(double num1, double num2, double num3) {

   if(floor(num1 * num2) == floor(num3)){

       return true;

   }

   else {

       return false;

   }

}

Explanation:

The function written in C++

This line defines the function

bool checkfloor(double num1, double num2, double num3) {

The following if condition checks if the floor of num1 * num2 equals num3

   if(floor(num1 * num2) == floor(num3)){

       return true; It returns true, if yes

   }

   else {

       return false; It returns false, if otherwise

   }

}

See attachment for full program including the main

Download cpp
4 0
3 years ago
Convert 234.43 (base 7) to base 10
miss Akunina [59]

Answer:

123.6326

Explanation:

Given number in base 7 : 234.43

Converting to base 10:

Each digit needs to be multiplied by 7^(position index)

Applying this for all the digits in the number:

=2* 7^2 + 3*7^1 + 4*7^0 + 4*7^-1 + 3*7^-2

=2*49 + 3*7 + 4 + 4/7+3/49

=98 + 21 + 4 + 0.5714 + 0.0612

Separating the integer and fraction parts:

=(98 + 21 + 4) + (0.5714 + 0.0612)

=123.6326

So the base 10 equivalent value for 234.43(base 7) is 123.6326

7 0
3 years ago
Selma writes the following four answers in her Computer Science examination.
REY [17]

Answer:

Interrupts.

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer on how to perform a specific task and solve a particular problem.

The four (4) input-output (I/O) software layers includes the following;

I. User level software: it provides user programs with a simple user interface to perform input and output functions.

II. Device drivers: it controls the input-output (I/O) devices that are connected to a computer system through a wired or wireless connection.

III. Device-independent OS software: it allows for uniform interfacing and buffering for device drivers.

IV. Interrupt drivers (handlers): it is responsible for handling interruptions that occur while using a software on a computer system.

An interrupt is a signal from a program or device connected to a computer and it's typically designed to instruct the operating system (OS) that an event has occurred and requires an attention such as stopping its current activities or processes.

In conclusion, the computer term that Selma is describing is interrupts.

3 0
3 years ago
Read 2 more answers
You do not need to use any functions beyond the main function in this problem. Initialize an array of int with the values: 4, 6,
zheka24 [161]

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

    int[] arr = {4, 6, 9, 12};

    int sum = 0;

   

    for(int i=0; i<arr.length; i++){

        sum += arr[i];

    }

   

    for(int i=0; i<arr.length; i++){

        System.out.print(arr[i] + " ");

    }

    System.out.println("");

 System.out.println("The sum of the numbers: " + sum);

}

}

Explanation:

* The code is written in Java.

- Initialize the array with the given numbers

- Initialize the <em>sum</em> variable as zero

- Calculate the sum in the first for loop

- Print the numbers in the second for loop

- Print the <em>sum</em>

4 0
3 years ago
Other questions:
  • What does OLE stand for? Object
    8·2 answers
  • Give a logical expression with variables p,q, and r that is true if p and q are false and r is true and is otherwise false.
    5·1 answer
  • Communication is defined as__________.
    10·1 answer
  • How does netbios identify a computer system on the network?
    13·1 answer
  • Help giving points mark BRAINLEST
    5·1 answer
  • Imagine you are a toy designer. How would you use measuring, dimensions, volume, and surface area information to create your toy
    10·2 answers
  • you are working on creating a business document with two other co-workers. Based on just information, which of the following pre
    14·1 answer
  • Jiz<br>Active<br>2<br>3<br>- 2(7 - 15)<br>What is the value of<br>4​
    10·2 answers
  • After turning on your computer ,it prompts you to type a password to continue the boot process. However ,you forgot the password
    10·1 answer
  • If the disaster requires actions offsite from the primary infrastructure, it is under the jurisdiction of__________.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!