nickname.php
Avoid using undefined variables such as '$db' which will lead to PHP notices. Open
Open
$response=$db->query("SELECT COUNT(nickname) FROM test_nickname");
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid unused local variables such as '$db'. Open
Open
$response=$db->query("SELECT COUNT(nickname) FROM test_nickname");
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 26 and the first side effect is on line 2. Open
Open
<?php
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "False" Open
Open
$exec_page = False;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "False" Open
Open
$public_page = False;
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "True" Open
Open
$active_page = True;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
include('mysql_access.php');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<!-- <input type="text" name="event_description"> -->
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<!-- <input type="hidden" name="event_type" value="Point"> -->
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<input type="text" name="event_title" >
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<!-- <p>Repeatable? -->
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$next = $result['COUNT(nickname)'] + 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<!-- <p>Description:<p> -->
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo "<input type='hidden' name='nickname' value=" . $next . ">";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<p>Nickname:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<!-- <p>Leadership Points: -->
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<!-- <input type="checkbox" name="repeatable"> -->
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<h1> Nickname Page </h1>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<form name="myform" action="nickname_created.php" method="post">
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<?php
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<!-- <input type="number" name="F_val" value="0"> -->
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<!-- <input type="submit" name="submit" value="create"/> -->
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$result=mysqli_fetch_array($response);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<!-- <input type="number" name="L_val" value="0"> -->
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<?php
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
</form>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
?>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$response=$db->query("SELECT COUNT(nickname) FROM test_nickname");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<p>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<!-- <p>Friendship Points: -->
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<!-- <input type="hidden" name="cap" value="0"> -->
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
require_once ('session.php');
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
require_once ('mysql_access.php');
- Exclude checks
Opening brace should be on a new line Open
Open
function show_active() {
- Exclude checks