Jump to content


This topic is now archived and is closed to further replies.


*SOLVED* PHP Calculator

Recommended Posts


I have a calculator on my site that adds up depending on the data passed over from the previous page

I have just installed a new email script as other one went up the shoot so I have had to change from

<?php echo $_POST["email"]; ?>


<?php print "$email";?>

If i use the old version the data doesnt show, the calculator I'm using is

$_POST['Adults'] = '2';
$start = 80;
$end = 0;
if("$kids" == '4'){
$end = $start + 17;
$end = $start + 0;
if($_POST['wintersports'] == '7'){
$end = $end + 25;
}elseif($_POST['wintersports'] == '14'){
$end = $end + 45;
$end = $end + 0;
if($_POST['Age'] == '18-70'){
$end = $end + 0;
}elseif($_POST['Age'] == '71+'){
$end = $end + 85;
$end = $end + 0;
$end = $start;
echo '£'.$end;

How can i make the calculator work again ???

Many thanks


Share this post

Link to post
Share on other sites
I would guess that the new script is sending variables via GET instead of POST.

Try altering the other variables the same way, eg. removing the $_POST['variable'] and just expressing them as $variable. Alternately, try substituting the $_POST with either $_GET, or $_REQUEST (which will catch both GET and POST data).

The first option should work, since the fact that $email works the same as $_POST['email'] suggests that register_globals is enabled.

Share this post

Link to post
Share on other sites


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.