我有一种php代码,在这我想发送连接变量($conn)到另一个页面,这样我就可以动态创建数据库表


I have sort of php code, in this i want to send connection variable ($conn) into another page so that i can create table for database dynamically

<?php    
    $a = $_GET['host'];
    $b = $_GET['username'];
    $c = $_GET['password'];
    $d = $_GET['db_name'];
    define("localhost",$a);
    define("username",$b);
    define("password",$c);
    define("db",$d);
    $conn = mysqli_connect(localhost,username,password);
    if($conn === false){
        die("ERROR: Could not connect. " . mysqli_connect_error());
    }
    // Attempt create database query execution
    $sql = "CREATE DATABASE $d ";
    if(mysqli_query($conn, $sql)){
        echo "Database demo created successfully";
        header("Location:create_table.php");    
    } else{
        echo "ERROR: Could not able to execute $sql. " . mysqli_error($conn);
    }
    // Close connection
    mysqli_close($conn);
?>

在这个我需要发送$conn头发送到create_table.php页面。因为我从用户那里得到了连接的细节。所以我不能将这个文件包含到create_table。php中。请帮忙找出如何将连接变量发送到另一个文件

<?php 
$server= "localhost";
$user= "root";
$pass= "";
$conn= mysqli_connection($server, $user, $pass);
if(!$conn){
echo "Database Connection Install Failed ! ".mysqli_errno() ;
}
else {
echo "Database Connection Establiseh Successfully! ";
}
?>