About PHP getting variable problems
PHP Code
@ $judge =$_get["Speed"];if (@ $keyboard =$_get["Keyboard"]) {$keyboardfinal = 100;} if (@ $judge ==1) {if ($keyboard <40 && $keyboard >0) {@ $keyboardfinal =50; }} if (@ $judge ==2) {if (@ $keyboard <50&& $keyboard >0) {$keyboardfinal =50; }} if (@ $judge ==3 && (@ $keyboard <170 && @ $keyboard >0)) {$keyboardfinal =50; }
If the above code ~ Why in the second, three, four if statements, even if the condition is not able to make $keyboardfinal=50;
------Solution--------------------
@ $judge =$_get["Speed"];
[Email protected]?
------Solution--------------------
Do not understand why the landlord to add so many error control, if not reported errors, how do you modify the code?
The code of the landlord changed the following:
PHP Code
$judge = 1; $keyboard =; $keyboardfinal = Null;switch ($judge) {case 1: if ($keyboard <40 && $keyboard >0) $keyboardfinal =50; break; Case 2: if ($keyboard <50&& $keyboard >0) $keyboardfinal =50; break; Case 3 && ($keyboard <170 && $keyboard >0): $keyboardfinal =50; break;} echo "keyboardfinal-->>". $keyboardfinal; #50
------Solution--------------------
Explore
PHP Code
@ $judge =$_get["Speed"];
if (@ $keyboard =$_get["Keyboard"]) {
$keyboardfinal = 100;
}
if (@ $judge ==1) {
if ($keyboard <40 && $keyboard >0) {
@ $keyboardfinal = 50;
}
}
if (@ $judge ==2) {
if (@ $keyb ...