Hello,
I am currently learning PHP, and I have a problem with some variables.
On the first page (choix.php), there is a form that lists product
categories.This is the concerned part:
echo "<form action='dc.php' method='post'>
<select name='p_type2' value='p_type2' > \n";
while ($ligne = mysql_fetch_arr ay($result))
{ extract($ligne) ;
echo "<option value='$p_type2 '>$p_type\n";
}
echo "</select>\n";
echo "<input type='submit'".
"value=\"Choisi ssez un type de produit\"></form>\n";?>
On the other page, dc.php , the program has to list the products in
the category chosen by the user above. I want the product chosen to be
inserted in
$typeproduit = "$HTTP_POST_VAR S[$p_type2]";
where $type_produit is the product chosen. (When i write, for
example,:
$type_produit = "CPU";
the program works. But it doesn't work when I put a variable. Can you
help me ?
Thank you
Ben C.
I am currently learning PHP, and I have a problem with some variables.
On the first page (choix.php), there is a form that lists product
categories.This is the concerned part:
echo "<form action='dc.php' method='post'>
<select name='p_type2' value='p_type2' > \n";
while ($ligne = mysql_fetch_arr ay($result))
{ extract($ligne) ;
echo "<option value='$p_type2 '>$p_type\n";
}
echo "</select>\n";
echo "<input type='submit'".
"value=\"Choisi ssez un type de produit\"></form>\n";?>
On the other page, dc.php , the program has to list the products in
the category chosen by the user above. I want the product chosen to be
inserted in
$typeproduit = "$HTTP_POST_VAR S[$p_type2]";
where $type_produit is the product chosen. (When i write, for
example,:
$type_produit = "CPU";
the program works. But it doesn't work when I put a variable. Can you
help me ?
Thank you
Ben C.
Comment