for løkke der ikke virker -Detox?
Det her virker:<?
$productname1 = "vare1";
$productname2 = "vare2";
$productname3 = "vare3";
$productname4 = "";
$amount1 = 10;
$amount2 = 20;
$amount3 = 30;
$amount4 = 0;
$product1 = "1";
$product2 = "1";
$product3 = "1";
$product4 = "0";
$price = " - Price: ";
$currency = ".00DK";
?>
<table width="462" border="0" cellspacing="0" cellpadding="20" height="264">
<form name="formular" method="POST" action="https://secure.webhosting.dk/pbsgateway/index.php">
<INPUT TYPE="HIDDEN" NAME="product1" VALUE="<?= $product1 ?>">
<INPUT TYPE="HIDDEN" NAME="product2" VALUE="<?= $product2 ?>">
<INPUT TYPE="HIDDEN" NAME="product3" VALUE="<?= $product3 ?>">
<INPUT TYPE="HIDDEN" NAME="product4" VALUE="<?= $product4 ?>">
<INPUT TYPE="HIDDEN" NAME="productname1" VALUE="<?= $productname1 ?>">
<INPUT TYPE="HIDDEN" NAME="productname2" VALUE="<?= $productname2 ?>">
<INPUT TYPE="HIDDEN" NAME="productname3" VALUE="<?= $productname3 ?>">
<INPUT TYPE="HIDDEN" NAME="productname4" VALUE="<?= $productname4 ?>">
<INPUT TYPE="HIDDEN" NAME="amount1" VALUE="<?= $amount1 ?>">
<INPUT TYPE="HIDDEN" NAME="amount2" VALUE="<?= $amount2 ?>">
<INPUT TYPE="HIDDEN" NAME="amount3" VALUE="<?= $amount3 ?>">
<INPUT TYPE="HIDDEN" NAME="amount4" VALUE="<?= $amount4 ?>">
Det her virker ikke:
<?
$productname1 = "vare1";
$productname2 = "vare2";
$productname3 = "vare3";
$productname4 = "";
$amount1 = 10;
$amount2 = 20;
$amount3 = 30;
$amount4 = 0;
$product1 = "1";
$product2 = "1";
$product3 = "1";
$product4 = "0";
$price = " - Price: ";
$currency = ".00DK";
$j=1;
?>
<table width="462" border="0" cellspacing="0" cellpadding="20" height="264">
<form name="formular" method="POST" action="https://secure.webhosting.dk/pbsgateway/index.php">
<?
for ($j=1; $j<2; $j++) {
if ( ${"product".$j} == 1){?>
<INPUT TYPE="HIDDEN" NAME="<?"amount$j"?>" VALUE="<?= ${"amount".$j}?>">
<INPUT TYPE="HIDDEN" NAME="<?"product$j"?>" VALUE="<?= ${"product".$j}?>">
<INPUT TYPE="HIDDEN" NAME="<?"productname$j"?>" VALUE="<?= ${"productname".$j}?>">
<?}}?>
Jeg aner ikke hvad problemet ér?
