I am sending the IP into the database by storing $_SERVER(REMOTE_ADDR) into a global variable, but I am having trouble trying to check if the IP of the host exists or not.
Following is the script I am trying to work with.
<?php
include_once('./db.php');
?>
<?php
$_SESSION[“sidIP”] = $_SERVER["REMOTE_ADDR"];
$checkIP = mysql_query("SELECT * FROM guardiansInfo WHERE sidIP = '".$_SESSION["sidIP"] . "'");
if(mysql_numrows($checkIP) > 0) {
echo 'It exists!';
} else {
echo 'It does not exist';
}
?>
<html>
<body>
nothing
</body>
</html>
This currently gives me this error in apache's log:
PHP Parse error: syntax error, unexpected '"', expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in ... DIRECTORY
What am I doing wrong?
I am a beginner... Go easy on me. '
EDIT: To those people that are here for answers and don't want to deal with idiotic comments: https://ghostbin.com/paste/kxa4v - I am a beginner, something stackoverflow does not have a concept of.