How to pass variables between php scripts?

To pass info via GET:

    header('Location: otherScript.php?var1=val1&var2=val2');

Session:

    // first script
    session_start(); 
    $_SESSION['varName'] = 'varVal';
    header('Location: second_script.php'); // go to other

    // second script
    session_start(); 
    $myVar = $_SESSION['varName'];

Post: Take a look at this.

Leave a Comment