I don’t really know any PHP and I can’t seem to understand why this script isn’t working. For context, it’s just a simple script that is connected to a xammp server for a chrome extension I’ve been trying to make. <?php if (!isset($_POST[‘key’])) { ### Authenticate input echo("Access Denied!"); exit(0); } $file = fopen("key.log","a+") if ..

Read more

I have an app that is written using procedural PHP. I’ve created an insert page where I take a buck of addresses and pass them as an array and insert them in the database. There I have the id of the row and then an orderId, the address type, and the address. Now I want ..

Read more

i’m trying to do something in PHP I’m trying to get the link of an image -> store it to my DB, but I’d like the user to be able to store text before it, and after it, I’ve gotten my hands on a similar function for links, but the image part is missing. As ..

Read more

The structure of the table I’m trying to reach is as such: Database: INTERNAL_STUFF Schema: INTERNAL_TEST Table: TEST_TABLE_SIMPLE I create a PDO as such: $dbh = new PDO("snowflake:account=$this->account", $this->user, $this->password); $dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); If I use this query: $result = $dbh->query("SELECT * FROM INTERNAL_STUFF.INTERNAL_TEST.TEST_TABLE_SIMPLE"); I end up getting this response – ‘Schema ‘INTERNAL_STUFF.INTERNAL_TEST’ does ..

Read more

Hello I’m working on a small script and I would like to add a firewall using HTTP Authentication. This is my code: $realm = ‘page’.uniqid(); if( $_SERVER[‘PHP_AUTH_USER’] != ‘FromDB’ || $_SERVER[‘PHP_AUTH_PW’] != ‘FromDB’ ) { header("WWW-Authenticate: Basic realm="$realm""); header(‘HTTP/1.0 401 Unauthorized’); echo ‘Access Denied’; exit; I would like to know if my code is secure ..

Read more