Ciao
sono alle prime esperienze col php e già un problema "grave"
ho scaricato uno scritp di una semplice calcolatrice e, eseguendo il file come l'ho scaricato, mi compare questo erroe abbastanza "banale" ma che nn sto riuscendo a risolvere da solo.
sono tutti concetti a me familiari(conosco c c++ e c#) ma nn riesco a districarmi!
qualcuno mi aiuta?
errore
Notice: Undefined variable: submit1 in c:\programmi\apache group\apache\htdocs\index.php on line 38
parte di codice incriminata
codice:
<hr>
<h2>Simple</h2>
<form action="<?php $PHP_SELF ?>" method="post">
<input name="first" type="text" size="6" maxlength="10">
<select name="method1">
<option value="add" selected>Add</option>
<option value="sub">Subtract</option>
<option value="multi">Multiply</option>
<option value="div">Divide</option>
</select>
<input name="second" type="text" size="6" maxlength="10">
<input name="submit1" type="submit" value="Calculate">
</form>
<?php
// Simple
if ($method1 == "add") {$ans = $first + $second;}
else if ($method1 == "sub") {$ans = $first - $second;}
else if ($method1 == "multi") {$ans = $first * $second;}
else if ($method1 == "div") {$ans = $first / $second;}
$ans = number_format($ans, 2, ',', ' ');
echo "
The answer is $ans</p>";
?>
è possibile che nn sia ben configurato php su apache o qualcosa del genere?
ciauz e grazie