i'm trying to call certain parts of my $_POST form info from a previous page we start on index.php, send the form in POST form over to contact.php, which then will email it off( that parts working though). what im having trouble is taking the post information putting it back into a session variable and sending it back to index.php. i can to do a foreach command for $_SESSION['pos'], and print out each variable one after the other, but its leaving me unable to put in things before their info, like name: and email:
contact.php
session_start(); //start session
$_SESSION['pos'] = $_POST; // tu $_POST info into $_session info
index.php
if(isset($_SESSION['pos'])){ //check to see if session info is set
echo '<div class="alert alert-info">'; //create alert div
$item = $_SESSION['pos']; //change session into variable for easier indexing?
echo "Name: ". $item[0]."<br><br>"; //echo line 0 from array
echo "Email: ". $item['1']."<br><br>"; //echo line 1 from array
echo "</div>"; //close alert div
}
session_unset();//unset session variables to avoid re-using them.
i really wish i knew how to correctly search for the answers i'm looking for. i feel horrible for having to resort to asking how to do this, because i'm sure the answers out there.
