Passing arrays through pages

Discussion in 'PHP' started by daryllsheridan, Mar 31, 2007.

  1. #1
    Hi

    I have created an array in one page, problem is i want to display it on another page. how do you go about transfering arrays from one page to another?

    Have had various attempts at it but havent got close in any of them

    The array is

    $arrErrors = array();

    Daryll
     
    daryllsheridan, Mar 31, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Try sessions.

    Page one
    
    <?php
    
    session_start();
    
    $_SESSION['errors'] = $arrErrors;
    
    ?>
    
    PHP:
    And page two
    
    <?php
    
    session_start();
    
    print_r($_SESSION['errors'])
    
    ?>
    
    PHP:
     
    nico_swd, Mar 31, 2007 IP
  3. daryllsheridan

    daryllsheridan Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Mate thats perfect

    Only starting out with PHP so sorry if some of the questions seem abit stupid! :p
     
    daryllsheridan, Mar 31, 2007 IP