![]() If you're connecting to a database other than MySQL, there is a driver-specific second option that you can refer to (for example, pg_prepare() and pg_execute() for PostgreSQL). $stmt->bind_param('s', $name) // 's' specifies the variable type => 'string' Using MySQLi (for MySQL): $stmt = $dbConnection->prepare('SELECT * FROM employees WHERE name = ?') Using PDO (for any supported database driver): $stmt = $pdo->prepare('SELECT * FROM employees WHERE name = :name') You basically have two options to achieve this: This way it is impossible for an attacker to inject malicious SQL. These are SQL statements that are sent to and parsed by the database server separately from any parameters. It is possible to create SQL statement with correctly formatted data parts, but if you don't fully understand the details, you should always use prepared statements and parameterized queries. The correct way to avoid SQL injection attacks, no matter which database you use, is to separate the data from SQL, so that data stays data and will never be interpreted as commands by the SQL parser. =THIS OUTPUTS THE CHANNEL SET BY THE WEBHOOK =\\ =CURL OPTIONS FOR POSTING THE INFORMATION PROVIDED ABOVE =\\Ĭurl_setopt( $ch, CURLOPT_POSTFIELDS, $make_json) Ĭurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1) Ĭurl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1) $json_data = array ('content'=>"$data", 'username'=>"New Visitor From $details->country", 'avatar_url'=> "$flag") $data = "**User IP:** $ip\n**Date:** $TheirDate\n**Time:** $TheirTime \n**Location:** $details->city \n**Region:** $details->region\n**Country** $details->country\n**Postal Code:** $details->zip" It is so simple and is commented so anyone that doesn't understand DiscordPHP->DiscordWebhook can see how and what does what :)įeel free to modify this your needs, I wanted to give something to the community that has helped me in the past so. Well here it is, the script you have been looking for. Simple answer is, so they can track the IPs coming into the website you host the DiscordPHP script on, simply to block/ban IPs and/or locations if you so wished. ![]() Question is why would someone create such a thing?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |