How can one pass data, such as an IP address, from one PHP script to another without causing delays in the main script's execution?

When passing data like an IP address from one PHP script to another without causing delays in the main script's execution, one efficient way is to use PHP sessions. By storing the IP address in a session variable, it can be accessed across different scripts without the need for constant passing of data. This helps maintain the flow of the main script's execution without interruptions.

// In the first PHP script
session_start();
$_SESSION['ip_address'] = $_SERVER['REMOTE_ADDR'];

// In the second PHP script
session_start();
$ip_address = $_SESSION['ip_address'];
echo "IP Address: " . $ip_address;