Hi,
I have a page with lots of different properties / houses. I want the users to be able to click on a button to save particular properties to a protfolio. When they click the Submit button they are taken to the portfolio page then return to add more to the portfolio before finally e-mailing the estate agents with their chosen properties from the portfolio page. So far I have found sessions easy to work with when using straight forward forms. Now I wish to use an array to store more than one property id so I can display more than one property on the portfolio page. Under each property I've tried using:
<form name='form1' method='post' action='PORTFOLIO.php'>
<input type='submit' name='submit' value='Add to Portfolio'>
<input type='hidden' name='id' value='$line[1]'>
and then on the portfolio.php page I would use,
session_start();
session_register("id");
foreach blah blah blah
if (eregi($id, $line[1])){
print<html> etc etc
and this would work but it would only show and save one property.
I should point out that I am using a comma delimited text file as a database (there is absolutely no way out of this) and use an explode function to output the properties onto the page as follows:
$array = file('../xfile.txt');
foreach($array as $row) {
$line = explode('","', $row);
print "<html><br>"
etc etc etc
Now I need to know how to populate an array using the $line[1] property from the $line array above. Can I use:
<form name='form1' method='post' action='PORTFOLIO.php'>
<input type='submit' name='submit' value='Add to Portfolio'>
<input type='hidden' name='id[number]' value='$line[1]'>
and
if (eregi($id[number], $line[1])){
I sorta tried this and also wondered how I would session_register() the array $id[number] array. I tried session_register("id[number][1]"); but I cant get that to work.
The URL of the site is
http://www.londonorient.com/sales.php and the text file is here Text file . Looking at these you can see how far I have got. you can see the line[1] property in the text file for example and how Ive managed to go from a horrible text file to a moderately nice page full of properties.
If you want to see the full html either to help me further or for your own benefit let me know.
Thanks for your help in adavnce. Hope some of this made sense!