I want to make a page where the user compares two products. I thought of putting data about the category, firm and the product (there going to be many products in the site on different categories) in select boxes. The user selects the category desired then two select boxes appear with the firms, selects one firm then select boxes for product appear and after selecting this the specification for the products appear.
I' m having problems at creating the session (on my local computer) in which the data about the last product viewed is stored. Session are set to start automaticly, create a cookie on the client machine with the path "/".
The following error appears:
I created tmp folder and granted RW for my user but still the warnings appear appear.Warning: Unknown(): open(/tmp\sess_5a501419b6f32067d1fa90269262b713, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
Second problem is that after selecting a value from the select boxes nothing happens even if put
Code: Select all
<form method='POST' action=<?php $_SERVER[PHP_SELF] ?>>
or
<form method='GET' action=<?php $_SERVER[PHP_SELF] ?> >Code: Select all
//the
if(!isset($_GET['prod_1']) && $_SESSION[prod]='')
{
?>
<form name='f' method='GET' action='<?php $_SERVER['PHP_SELF']?>'>
<table>
<tr>
<td colspan='2'>Pick the category of the products you wish to compare: </td>
<!-- filling the select box with the names of the categories -->
<td><select name='categ'><?php sel_c()?></select></td>
</tr>
<?php
} //displaying after a category is selected the companies that have products in it
if(isset($_GET['categ']))
{
?>
<tr>
<td>Pick the company which makes the desired product:
<!-- displays the
<td><select name='firma_1'><?php sel_f($categ) ?></select></td>
<td><select name='firma_2'><?php sel_f($categ) ?></select></td>
</tr>
<?php
//similar for products
if(isset($_GET['firma_1']) || isset($_GET[firma_2]))
{ ...}
if(isset ($_GET[Compare]))
{
?>
<tr> <td>displayProduct($product1)</td>
<td>displayProduct($product2)</td>
</tr>
<?php
}
?>