Jump to content

$_POST limit


otuatail

Recommended Posts

Click the reply button instead of using quick reply.
Copy and paste all the text into this form, including your opening <?php tags. Then highlight all the code, and press the # button. This will put it in code tags. This makes it easy for us to read and help you.
Link to comment
Share on other sites

Line 38 is the text boxx Lines 77-79 use the post

Page = http://www.des-otoole.co.uk/utility2/utility_compare.php

code =


#
<?
$stamp = time();
$val = date("d-m-Y H:i:s",$stamp);
//echo($val);
print_r($_POST);
// echo $randval = rand();
?>
<html>
<title>Utility</title>
<body>
<form action="utility_compare.php" method="post">
<table border="0">
<tr><td colspan="2" align="center" height="50"><b><u>UN-Capped</u></b>
<td width="30"></td>
<td colspan="2" align="center" height="50"><b><u>Capped</u></b></tr><td width="30"></td>
<tr><td colspan="5" align="center"><b>Electric Reading</b></tr>
<tr>
<td>High p </td><td><input type="text" name="E_U_High" value="12.702" size="4"></td><td></td>
<td>High p </td><td><input type="text" name="E_C_High" value="12.970" size="4"></td><td></td>
<td>Units </td><td><input type="text" name="E_Units" value="4844" size="4"></td>
</tr>
<tr>
<td>Low p </td><td><input type="text" name="E_U_Low" value="7.292" size="4"></td><td></td>
<td>Low p </td><td><input type="text" name="E_C_Low" value="5.560" size="4"></td>
</tr>

<tr><td colspan="6"><hr></tr>

<tr><td colspan="6" align="center"><b>Gas Reading</b></tr>
<tr>
<td>High p </td><td><input type="text" name="G_U_High" value="3.422" size="4"></td><td></td>
<td>High p </td><td><input type="text" name="G_C_High" value="2.912" size="4"></td><td></td>
<td>Units </td><td><input type="text" name="G_Units" value="480" size="4"></td>
</tr>
<tr>
<td>Low p </td><td><input type="text" name="G_U_Low" value="2.417" size="4"></td><td></td>
<td>Low p </td><td><input type="text" name="G_C_Low" value="1.619" size="4"></td><td></td>
<td>Kwh </td><td><input type="text" name="G_Kwh" value="11.52" size="4"></td>
</tr>
<tr><td colspan="6"><hr></tr>
<tr><td colspan="5" align="center"><input type="submit" value="Calculate" Name="submit" </td></tr>
</table>

<?
// Electric Uncapped *******
if($_POST['E_Units'] > 900)
    {
    $E_High_Units = 900;
    $E_Low_Units = $_POST['E_Units'] - 900;
    }
else
    {
    $E_High_Units = $_POST['E_Units'];
    $E_Low_Units = 0;
    }

if($_POST['G_Units'] > 100)
    {
    $G_High_Units = 100;
    $G_Low_Units = $_POST['G_Units'] - 100;
    }
else
    {
    $G_High_Units = $_POST['G_Units'];
    $G_Low_Units = 0;
    }

// Electric Uncapped *******
$E_U_High_val = $_POST['E_U_High'] * $E_High_Units / 100;
$E_U_Low_val = $_POST['E_U_Low'] * $E_Low_Units / 100;
// Electric Capped ********
$E_C_High_val = $_POST['E_C_High'] * $E_High_Units / 100;
$E_C_Low_val = $_POST['E_C_Low'] * $E_Low_Units / 100;

//    GAS Uncapped *******

$_KWH = $_POST['G_Kwh'];
$_KWH = '11.52'; //Use this instead
echo '$_KWH = ' . $_KWH;
$G_U_High_val = $_POST['G_U_High'] * $G_High_Units / 100 * $_KWH;
$G_U_Low_val = $_POST['G_U_Low'] * $G_Low_Units / 100 * $_KWH;
//    GAS Capped *******
$G_C_High_val = $_POST['G_C_High'] * $G_High_Units / 100 * $_KWH;
$G_C_Low_val = $_POST['G_C_Low'] * $G_Low_Units / 100 * $_KWH;

$Uncap_total = $E_U_High_val + $E_U_Low_val + $G_U_High_val + $G_U_Low_val;
$Cap_total = $E_C_High_val + $E_C_Low_val + $G_C_High_val + $G_C_Low_val;
if($Cap_total > 0)
    $Percent = ($Uncap_total - $Cap_total) / $Cap_total * 100;
else
    $Percent = 0;
?>
<table border="0">
<tr><td><?=$E_High_Units?> * <?=$_POST['E_U_High']?> = </td><td>£<?=money_format("%4.2n",$E_U_High_val)?></td></tr>
<tr><td><?=$E_Low_Units?> * <?=$_POST['E_U_Low']?> = </td><td>£<?=money_format("%3.2n", $E_U_Low_val)?></td></tr>
<tr><td width="80">Total</td><td>£<?=money_format("%3.2n", ($E_U_High_val + $E_U_Low_val))?></td></tr>
<tr><td colspan="2"><hr></td></tr>

<tr><td><?=$G_High_Units?> * <?=$_POST['G_U_High']?> = </td><td>£<?=money_format("%3.2n", $G_U_High_val)?></td></tr>
<tr><td><?=$G_Low_Units?> * <?=money_format("%3.3n", $_POST['G_U_Low'])?> = </td>
<td width="80">£<?=money_format("%3.2n", $G_U_Low_val)?></td></tr>
<tr><td>Total </td><td>£<?=money_format("%3.2n", $G_U_High_val + $G_U_Low_val)?></td>
<td>£<?=money_format("%3.2n", ($Uncap_total))?></td>
<td><b>UN-Capped</b><td></tr>
<tr><td colspan="3" height="30"><hr></td></tr>


<tr><td><?=$E_High_Units?> * <?=$_POST['E_C_High']?> = </td><td>£<?=$E_C_High_val?></td></tr>
<tr><td><?=$E_Low_Units?> * <?=money_format("%10.2n", $_POST['E_C_Low'])?> = </td>
<td>£<?=money_format("%3.2n", $E_C_Low_val)?></td></tr>
<tr><td>Total</td><td>£<?=money_format("%3.2n", $E_C_High_val + $E_C_Low_val)?></td></tr>
<tr><td colspan="2"><hr></td></tr>
<tr><td><?=$G_High_Units?> * <?=$_POST['G_C_High']?> = </td><td>£<?=money_format("%3.2n", $G_C_High_val)?></td></tr>
<tr><td><?=$G_Low_Units?> * <?=$_POST['G_C_Low']?> = </td><td>£<?=money_format("%3.2n", $G_C_Low_val)?></td></tr>
<tr><td>Total </td><td>£<?=money_format("%3.2n", ($G_C_High_val + $G_C_Low_val))?></td>
<td>£<?=money_format("%3.2n", $Cap_total)?></td>
<td><b>Capped</b><td></tr>
<tr><td>£<?=money_format("%3.2n",($Uncap_total - $Cap_total))?></td><td><?=money_format("%3.2n",$Percent)?>%</td></tr>
</table>
</form>
</body>
</html>
#
Link to comment
Share on other sites

You know you have several inputs with the same name, right?

Anyway, when I do it, the box on line 38 shows up in the list.
Array ( [E_U_High] => 12.702 [E_C_High] => 12.970 [E_Units] => 4844 [E_U_Low] => 7.292 [E_C_Low] => 5.560 [G_U_High] => 3.422 [G_C_High] => 2.912 [G_Units] => 480 [G_U_Low] => 2.417 [G_C_Low] => 1.619 [G_Kwh] => 12 [submit] => Calculate )
Link to comment
Share on other sites

Sorry never done this before is this right?
Line 38 is the text box Lines 77-79 use the post
I can't see any duplication of name of text boxes

Page = http://www.des-otoole.co.uk/utility2/utility_compare.php

code =

[code]<?
$stamp = time();
$val = date("d-m-Y H:i:s",$stamp);
//echo($val);
print_r($_POST);
// echo $randval = rand();
?>
<html>
<title>Utility</title>
<body>
<form action="utility_compare.php" method="post">
<table border="0">
<tr><td colspan="2" align="center" height="50"><b><u>UN-Capped</u></b>
<td width="30"></td>
<td colspan="2" align="center" height="50"><b><u>Capped</u></b></tr><td width="30"></td>
<tr><td colspan="5" align="center"><b>Electric Reading</b></tr>
<tr>
<td>High p </td><td><input type="text" name="E_U_High" value="12.702" size="4"></td><td></td>
<td>High p </td><td><input type="text" name="E_C_High" value="12.970" size="4"></td><td></td>
<td>Units </td><td><input type="text" name="E_Units" value="4844" size="4"></td>
</tr>
<tr>
<td>Low p </td><td><input type="text" name="E_U_Low" value="7.292" size="4"></td><td></td>
<td>Low p </td><td><input type="text" name="E_C_Low" value="5.560" size="4"></td>
</tr>

<tr><td colspan="6"><hr></tr>

<tr><td colspan="6" align="center"><b>Gas Reading</b></tr>
<tr>
<td>High p </td><td><input type="text" name="G_U_High" value="3.422" size="4"></td><td></td>
<td>High p </td><td><input type="text" name="G_C_High" value="2.912" size="4"></td><td></td>
<td>Units </td><td><input type="text" name="G_Units" value="480" size="4"></td>
</tr>
<tr>
<td>Low p </td><td><input type="text" name="G_U_Low" value="2.417" size="4"></td><td></td>
<td>Low p </td><td><input type="text" name="G_C_Low" value="1.619" size="4"></td><td></td>
<td>Kwh </td><td><input type="text" name="G_Kwh" value="11.52" size="4"></td>
</tr>
<tr><td colspan="6"><hr></tr>
<tr><td colspan="5" align="center"><input type="submit" value="Calculate" Name="submit" </td></tr>
</table>

<?
// Electric Uncapped *******
if($_POST['E_Units'] > 900)
    {
    $E_High_Units = 900;
    $E_Low_Units = $_POST['E_Units'] - 900;
    }
else
    {
    $E_High_Units = $_POST['E_Units'];
    $E_Low_Units = 0;
    }

if($_POST['G_Units'] > 100)
    {
    $G_High_Units = 100;
    $G_Low_Units = $_POST['G_Units'] - 100;
    }
else
    {
    $G_High_Units = $_POST['G_Units'];
    $G_Low_Units = 0;
    }

// Electric Uncapped *******
$E_U_High_val = $_POST['E_U_High'] * $E_High_Units / 100;
$E_U_Low_val = $_POST['E_U_Low'] * $E_Low_Units / 100;
// Electric Capped ********
$E_C_High_val = $_POST['E_C_High'] * $E_High_Units / 100;
$E_C_Low_val = $_POST['E_C_Low'] * $E_Low_Units / 100;

//    GAS Uncapped *******

$_KWH = $_POST['G_Kwh'];
$_KWH = '11.52'; //Use this instead
echo '$_KWH = ' . $_KWH;
$G_U_High_val = $_POST['G_U_High'] * $G_High_Units / 100 * $_KWH;
$G_U_Low_val = $_POST['G_U_Low'] * $G_Low_Units / 100 * $_KWH;
//    GAS Capped *******
$G_C_High_val = $_POST['G_C_High'] * $G_High_Units / 100 * $_KWH;
$G_C_Low_val = $_POST['G_C_Low'] * $G_Low_Units / 100 * $_KWH;

$Uncap_total = $E_U_High_val + $E_U_Low_val + $G_U_High_val + $G_U_Low_val;
$Cap_total = $E_C_High_val + $E_C_Low_val + $G_C_High_val + $G_C_Low_val;
if($Cap_total > 0)
    $Percent = ($Uncap_total - $Cap_total) / $Cap_total * 100;
else
    $Percent = 0;
?>
<table border="0">
<tr><td><?=$E_High_Units?> * <?=$_POST['E_U_High']?> = </td><td>£<?=money_format("%4.2n",$E_U_High_val)?></td></tr>
<tr><td><?=$E_Low_Units?> * <?=$_POST['E_U_Low']?> = </td><td>£<?=money_format("%3.2n", $E_U_Low_val)?></td></tr>
<tr><td width="80">Total</td><td>£<?=money_format("%3.2n", ($E_U_High_val + $E_U_Low_val))?></td></tr>
<tr><td colspan="2"><hr></td></tr>

<tr><td><?=$G_High_Units?> * <?=$_POST['G_U_High']?> = </td><td>£<?=money_format("%3.2n", $G_U_High_val)?></td></tr>
<tr><td><?=$G_Low_Units?> * <?=money_format("%3.3n", $_POST['G_U_Low'])?> = </td>
<td width="80">£<?=money_format("%3.2n", $G_U_Low_val)?></td></tr>
<tr><td>Total </td><td>£<?=money_format("%3.2n", $G_U_High_val + $G_U_Low_val)?></td>
<td>£<?=money_format("%3.2n", ($Uncap_total))?></td>
<td><b>UN-Capped</b><td></tr>
<tr><td colspan="3" height="30"><hr></td></tr>


<tr><td><?=$E_High_Units?> * <?=$_POST['E_C_High']?> = </td><td>£<?=$E_C_High_val?></td></tr>
<tr><td><?=$E_Low_Units?> * <?=money_format("%10.2n", $_POST['E_C_Low'])?> = </td>
<td>£<?=money_format("%3.2n", $E_C_Low_val)?></td></tr>
<tr><td>Total</td><td>£<?=money_format("%3.2n", $E_C_High_val + $E_C_Low_val)?></td></tr>
<tr><td colspan="2"><hr></td></tr>
<tr><td><?=$G_High_Units?> * <?=$_POST['G_C_High']?> = </td><td>£<?=money_format("%3.2n", $G_C_High_val)?></td></tr>
<tr><td><?=$G_Low_Units?> * <?=$_POST['G_C_Low']?> = </td><td>£<?=money_format("%3.2n", $G_C_Low_val)?></td></tr>
<tr><td>Total </td><td>£<?=money_format("%3.2n", ($G_C_High_val + $G_C_Low_val))?></td>
<td>£<?=money_format("%3.2n", $Cap_total)?></td>
<td><b>Capped</b><td></tr>
<tr><td>£<?=money_format("%3.2n",($Uncap_total - $Cap_total))?></td><td><?=money_format("%3.2n",$Percent)?>%</td></tr>
</table>
</form>
</body>
</html>[/code]
Link to comment
Share on other sites

<td>High p </td><td><input type="text" name="E_U_High" value="12.702" size="4"></td><td></td>
<td>High p </td><td><input type="text" name="E_C_High" value="12.970" size="4"></td><td></td>

Those two have the same name, as do many others.

Which is the one that isn't showing up for you? I see all of them. Line 38 is the "G_Kwh" one, which is in the POST array I copied. It works fine...
Link to comment
Share on other sites

Right, I thought both were U.
Either way, what is the MISSING one? I have asked several times exactly which one you think is missing, and you keep saying Line 38. Well, I told you the input named in line 38 is IN the $_POST.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.