Great News!! I got it working but on a much larger scale. My question was simplified to make it easier for folks to reply. Anyhow my script now looks like this:
Page 1:
<?php
$array = file('../xfile.txt'); //The database
$anything=array_shift($array);
foreach($array as $row) {
$line = explode('","', $row);
print "Name: $line[1]";
<form name='form1' method='post' action='lettings19.php'>
<input type='submit' name='submit' value='Add to Portfolio'>
<input type='hidden' name='name' value='$line[1]'>
</form>
Page 2:
<?php
if(!isset($SESSION['name'])){
$SESSION['name'] = array();
}
array_push($SESSION['name'], $REQUEST['name']);
$hello = file('../xfile.txt');
$anything=array_shift($hello);
foreach($hello as $row) {
$lin = explode('","', $row);
if (in_array($lin[1], $_SESSION['name'])){
print "Name: $line[1] etc etc etc etc
This works a treat. Now I have to work out how to delete individual names from the array and delete the whole array.
Thanks for your help!!!