add.php
Avoid using undefined variables such as '$subject' which will lead to PHP notices. Open
Open
mail($to,$subject,$message,$headers);
- Read upRead up
- Create a ticketCreate a ticket
- 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 using undefined variables such as '$message' which will lead to PHP notices. Open
Open
mail($to,$subject,$message,$headers);
- Read upRead up
- Create a ticketCreate a ticket
- 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 using undefined variables such as '$to' which will lead to PHP notices. Open
Open
mail($to,$subject,$message,$headers);
- Read upRead up
- Create a ticketCreate a ticket
- 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 using undefined variables such as '$headers' which will lead to PHP notices. Open
Open
mail($to,$subject,$message,$headers);
- Read upRead up
- Create a ticketCreate a ticket
- 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 '$subject'. Open
Open
mail($to,$subject,$message,$headers);
- Read upRead up
- Create a ticketCreate a ticket
- 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
Avoid unused local variables such as '$headers'. Open
Open
mail($to,$subject,$message,$headers);
- Read upRead up
- Create a ticketCreate a ticket
- 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
Avoid unused local variables such as '$to'. Open
Open
mail($to,$subject,$message,$headers);
- Read upRead up
- Create a ticketCreate a ticket
- 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
Avoid unused local variables such as '$message'. Open
Open
mail($to,$subject,$message,$headers);
- Read upRead up
- Create a ticketCreate a ticket
- 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
Call to undeclared function \mysql_fetch_array()
Open
Open
$req1 = mysql_fetch_array(mysql_query('SELECT max(id) AS `id` FROM `topsite`'));
- Create a ticketCreate a ticket
- Exclude checks
Variable $sname
is undeclared Open
Open
You recieved this message after the subscription of your website (".$_POST['url'].") on our top site at '.$sname.'.
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared function \mysql_query()
Open
Open
if(mysql_query("INSERT INTO `topsite` (id, name, url, clicks, description, banner, email, status) VALUES ('', '".$_POST['name']."', '".$_POST['url']."', 0, '".$_POST['description']."', '".$_POST['banner']."', '".$_POST['email']."', 'no')"))
- Create a ticketCreate a ticket
- Exclude checks
Variable $mail_webmaster
is undeclared Open
Open
$headers .= "Reply-To: ".$mail_webmaster."\n";
- Create a ticketCreate a ticket
- Exclude checks
Variable $sname
is undeclared Open
Open
$headers = "From: \"".$sname." Admin\"<".$mail_webmaster.">\n";
- Create a ticketCreate a ticket
- Exclude checks
Variable $headers
is undeclared Open
Open
mail($to,$subject,$message,$headers);
- Create a ticketCreate a ticket
- Exclude checks
Variable $subject
is undeclared Open
Open
mail($to,$subject,$message,$headers);
- Create a ticketCreate a ticket
- Exclude checks
Variable $message
is undeclared Open
Open
mail($to,$subject,$message,$headers);
- Create a ticketCreate a ticket
- Exclude checks
Variable $sname
is undeclared Open
Open
$dc = "Add your site to link directory at ".$sname;
- Create a ticketCreate a ticket
- Exclude checks
Variable $sname
is undeclared Open
Open
$subject = 'Your website subscription at '.$sname;
- Create a ticketCreate a ticket
- Exclude checks
Variable $to
is undeclared Open
Open
mail($to,$subject,$message,$headers);
- Create a ticketCreate a ticket
- Exclude checks
Variable $mail_webmaster
is undeclared Open
Open
$headers = "From: \"".$sname." Admin\"<".$mail_webmaster.">\n";
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared function \mysql_close()
Open
Open
mysql_close();
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared function \mysql_query()
Open
Open
$req1 = mysql_fetch_array(mysql_query('SELECT max(id) AS `id` FROM `topsite`'));
- Create a ticketCreate a ticket
- Exclude checks
Avoid variables with short names like $to. Configured minimum length is 3. Open
Open
mail($to,$subject,$message,$headers);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}