Archive: March 2023

Only Allow Access to Page if Arrived from Assigned

One way to allow access to a page only if the user came from an assigned page is by using PHP sessions. You can set a session variable on the assigned page and then check for that variable on the page you want to restrict access to. If the session variable is not set, you can redirect the user to another page1. For example, on the assigned page you can set a session variable like this:

AlmaLinux Manual Install PHP Extensions

AlmaLinux missing extensions installed manually is easy to do. Here's an easy way to manually of install extensions. This example was for aaPanel running AlmaLinux 8. In this example we will install bz2: 1. `cd /www/server/php/82/src/ext/bz2` 2. `/www/server/php/82/bin/phpize` 3. `./configure --with-php-config=/www/server/php/82/bin/php-config` 4. `make` 5. `make test` 6. `make install` As

PHP CURL Openai Remove Quotes from Post Data

Having a hard time getting PHP Curl to work with your post data? I damn near drove me to drinking :) So, you have something like this after using $openaiTemp = $_POST[openaiTemp]; $postData = [ 'model' => $openaiModel, 'prompt' => $openaiModel, 'temperature' => "0.7", 'max_tokens => "2150", 'top_p' => "1", Those pesky double quotes are wrecking the array. There are a couple of ways