Hey,
So I'm having ago at doing a little CMS for some hotel I'm planning on, I'm keepong OOP to the minimum, but using MySQLi but I'm having trouble on how to secure, I've read up quite a bit but unsure still.
This is my code I'm wanting to secure;
I've been looking at the bind_param, but I'm sure I was doing it wrong, and on the PHP.NET website it says no longer to use that, but to use 'stmt_bind_param'. All help will be appreciated .
- Cheers.
So I'm having ago at doing a little CMS for some hotel I'm planning on, I'm keepong OOP to the minimum, but using MySQLi but I'm having trouble on how to secure, I've read up quite a bit but unsure still.
This is my code I'm wanting to secure;
PHP:
$CorpID = $_GET['id'];
$getCorpInfo = $mysqli->query("SELECT * FROM `jobs_employers` WHERE `id` = '".$CorpID."'") or die($mysqli->error);
if($getCorpInfo->num_rows == 0)
{
header("Location: index.php");
exit;
}
else
{
$corpInfo = $getCorpInfo->fetch_object();
$getOwnerInfo = $mysqli->query("SELECT * FROM `characters` WHERE `id` = '".$corpInfo->owner."'") or die($mysqli->error);
$ownerInfo = $getOwnerInfo->fetch_object();
}
I've been looking at the bind_param, but I'm sure I was doing it wrong, and on the PHP.NET website it says no longer to use that, but to use 'stmt_bind_param'. All help will be appreciated .
- Cheers.