Question:

What's wrong with this code?

by  |  earlier

0 LIKES UnLike

i'm a new php programmer and i was working on a simple calc.. when i was testing it on localhost it works good but when i upload it to an online host it gives me (Notice: Undefined variable)

http://light557.hostbot.com/index.html

so what's wrong with it??

 Tags:

   Report

1 ANSWERS


  1. in index.php replace all with this:

    <?

    include ("index.html");

    include ("calc.class.php");

    $jm = $_POST['jm'];

    $tb1 = $_POST['tb1'];

    $tb2 = $_POST['tb2'];

    $calc1=new calc();

    if($jm=='+')

    {

    print $calc1->add($tb1,$tb2);

    }elseif($jm=='-'){

    print $calc1->minus($tb1,$tb2);

    }elseif($jm=='*'){

    print $calc1->mul($tb1,$tb2);

    }elseif($jm=='/'){

    print $calc1->div($tb1,$tb2);

    }

    ?>

    Good luck!

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.