0

I've upploade my php codes under the address http://george.freeoda.com, my problem is the calc link located on the http://george.freeoda.com/calc.php, this php files processess successfully on my server locally, what might be the problem?

my full php codes are:

<?php 
$n1 = &$_POST['n1'];  // textbo1 declaration
$n2 = &$_POST['n2'];  // textbo2 declation
   if (isset($_POST['Button'])) {   // check if a button is clicked


    if (isset($_POST['string'])) { 


    $selected_radio = $_POST['string'];
if(is_numeric($n1) && is_numeric($n2)) {   
  switch($selected_radio)  {        
        // a function to count words used in a string enterd  
            case 'minus':
       echo "<font color = 'red'>",$n1, "</font> - " ,"<font color = 'red'>",$n2, "</font> =  ", $n1 - $n2;            
             break;
      case  'devide': 
            echo "<font color = 'red'>",$n1, "</font> / ","<font color = 'red'>" ,$n2, "</font> =  ", $n1 /$n2;     
                   break;
             case 'multiply' :
            echo "<font color = 'red'>",$n1, "</font> * ","<font color = 'red'>" ,$n2, "</font>  =  ", $n1 * $n2;
                   break;
        default:
            echo "<font color = 'red'>",$n1, "</font> + ","<font color = 'red'>" ,$n2, "</font>  =  ", $n1 + $n2;
           } 

        }


       else
        echo "<font color = 'red'>Enter only numbers</font><br>"  ;
       }
    if(empty($n1) && empty($n2)) {
    echo "<font color = 'red'>Fill in First number and Second number</font>";}                  
       }

?>
or follow the link http://george.freeoda.com/calc.txt.

What's wrong with my codes guys?
can someone figure out the problem for me?

3
Contributors
3
Replies
19
Views
4 Years
Discussion Span
Last Post by tshukela.george
0
<?php
echo phpinfo();
?>

type phpinfo() and display the result so that we can know what is your server config.
If above code works then it will be sure that php is working in your server and we can check what else might cause this problem.

0

If you are just submitting the form back to the same page, why not use

action="<?php echo $_SERVER['PHP_SELF']; ?>" >

Also, your form action is submitting to Calc.php which your host doesn't like, probably because of the capital "C".

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.