if (@!$_COOKIE['true']){
Well that's one bad name for a cookie. This doesn't say anything about what this cookie is used for.
if ($currentTime >= $timeCheck){
require_once 'upload/mysqlserver/login.php';
$query = "SELECT * FROM poems";
$queryRun = mysql_query($query);
if ($queryRun = mysql_query($query)){
Your indentation goes a bit off on these lines, correcting that makes it:
if ($currentTime >= $timeCheck) {
require_once 'upload/mysqlserver/login.php';
$query = "SELECT * FROM poems";
$queryRun = mysql_query($query);
if ($queryRun = mysql_query($query)) {
...
Additionally, you are setting the value of $queryRun
twice. You can change that too:
$queryRun = mysql_query($query);
if ($queryRun) {
Also, YOU ARE USING THE DEPRECATED MYSQL_ FUNCTIONS*. You should really use the mysqli_
functions instead. Apparently you have not read the documentation for mysql_query
where there is a big red box essentially saying: Don't use this.
if (mysql_num_rows($queryRun)== NULL) {
This method does not return NULL
, it can return false
though, which when comparing with ==
is equal to null. However, I would recommend comparing with ===
. So that would become:
if (mysqli_num_rows($queryRun) === false) {
$query2 = "SELECT poem_name, poem, author, time_posted FROM poems WHERE id=$maxNum";
This is vulnerable to SQL Injection if somehow $maxNum
would somehow get the value 0; DROP TABLE poems;
Always use parametrized SQL queries! Always use parametrized SQL queries!
$PoTDset = $poemSet = "<br />
Do you really need both $PoTDset
and $poemSet
?
if (@!$_COOKIE['true']){
Well that's one bad name for a cookie. This doesn't say anything about what this cookie is used for.
if ($currentTime >= $timeCheck){
require_once 'upload/mysqlserver/login.php';
$query = "SELECT * FROM poems";
$queryRun = mysql_query($query);
if ($queryRun = mysql_query($query)){
Your indentation goes a bit off on these lines, correcting that makes it:
if ($currentTime >= $timeCheck) {
require_once 'upload/mysqlserver/login.php';
$query = "SELECT * FROM poems";
$queryRun = mysql_query($query);
if ($queryRun = mysql_query($query)) {
...
Additionally, you are setting the value of $queryRun
twice. You can change that too:
$queryRun = mysql_query($query);
if ($queryRun) {
Also, YOU ARE USING THE DEPRECATED MYSQL_ FUNCTIONS*. You should really use the mysqli_
functions instead. Apparently you have not read the documentation for mysql_query
where there is a big red box essentially saying: Don't use this.
if (mysql_num_rows($queryRun)== NULL) {
This method does not return NULL
, it can return false
though, which when comparing with ==
is equal to null. However, I would recommend comparing with ===
. So that would become:
if (mysqli_num_rows($queryRun) === false) {
$query2 = "SELECT poem_name, poem, author, time_posted FROM poems WHERE id=$maxNum";
This is vulnerable to SQL Injection if somehow $maxNum
would somehow get the value 0; DROP TABLE poems;
Always use parametrized SQL queries!
$PoTDset = $poemSet = "<br />
Do you really need both $PoTDset
and $poemSet
?
if (@!$_COOKIE['true']){
Well that's one bad name for a cookie. This doesn't say anything about what this cookie is used for.
if ($currentTime >= $timeCheck){
require_once 'upload/mysqlserver/login.php';
$query = "SELECT * FROM poems";
$queryRun = mysql_query($query);
if ($queryRun = mysql_query($query)){
Your indentation goes a bit off on these lines, correcting that makes it:
if ($currentTime >= $timeCheck) {
require_once 'upload/mysqlserver/login.php';
$query = "SELECT * FROM poems";
$queryRun = mysql_query($query);
if ($queryRun = mysql_query($query)) {
...
Additionally, you are setting the value of $queryRun
twice. You can change that too:
$queryRun = mysql_query($query);
if ($queryRun) {
Also, YOU ARE USING THE DEPRECATED MYSQL_ FUNCTIONS*. You should really use the mysqli_
functions instead. Apparently you have not read the documentation for mysql_query
where there is a big red box essentially saying: Don't use this.
if (mysql_num_rows($queryRun)== NULL) {
This method does not return NULL
, it can return false
though, which when comparing with ==
is equal to null. However, I would recommend comparing with ===
. So that would become:
if (mysqli_num_rows($queryRun) === false) {
$query2 = "SELECT poem_name, poem, author, time_posted FROM poems WHERE id=$maxNum";
This is vulnerable to SQL Injection if somehow $maxNum
would somehow get the value 0; DROP TABLE poems;
Always use parametrized SQL queries!
$PoTDset = $poemSet = "<br />
Do you really need both $PoTDset
and $poemSet
?
if (@!$_COOKIE['true']){
Well that's one bad name for a cookie. This doesn't say anything about what this cookie is used for.
if ($currentTime >= $timeCheck){
require_once 'upload/mysqlserver/login.php';
$query = "SELECT * FROM poems";
$queryRun = mysql_query($query);
if ($queryRun = mysql_query($query)){
Your indentation goes a bit off on these lines, correcting that makes it:
if ($currentTime >= $timeCheck) {
require_once 'upload/mysqlserver/login.php';
$query = "SELECT * FROM poems";
$queryRun = mysql_query($query);
if ($queryRun = mysql_query($query)) {
...
Additionally, you are setting the value of $queryRun
twice. You can change that too:
$queryRun = mysql_query($query);
if ($queryRun) {
Also, YOU ARE USING THE DEPRECATED MYSQL_ FUNCTIONS*. You should really use the mysqli_
functions instead. Apparently you have not read the documentation for mysql_query
where there is a big red box essentially saying: Don't use this.
if (mysql_num_rows($queryRun)== NULL) {
This method does not return NULL
, it can return false
though, which when comparing with ==
is equal to null. However, I would recommend comparing with ===
. So that would become:
if (mysqli_num_rows($queryRun) === false) {
$query2 = "SELECT poem_name, poem, author, time_posted FROM poems WHERE id=$maxNum";
This is vulnerable to SQL Injection if somehow $maxNum
would somehow get the value 0; DROP TABLE poems;
Always use parametrized SQL queries!
$PoTDset = $poemSet = "<br />
Do you really need both $PoTDset
and $poemSet
?