Show Content to SEO but Forward Users

Very simple process but use with care! Seriously, you really should think long and hard before using in any SEO campaigns. Used responsibly, this is a power tool. Using wreckfully can cause your site to be banned from search engine platforms, you have been warned. In this code, strpos function is used to check if the User-Agent string contains 'Googlebot' or 'bingbot'. If it does, it means the

Identifying Local & Network Drives in Windows 10+

Sometimes we need to identify local and network dives on Windows machines. Since Windows 10+ no longer support (or soon to be) wmic, needed a simple way to use PHP. $fso = new COM('Scripting.FileSystemObject'); $D = $fso->Drives; $type = array("Unknown","Removable","Fixed","Network","CD-ROM","RAM Disk"); foreach($D as $d ){ $dO = $fso->GetDrive($d); $s = ""; if($dO->DriveType == 3){ $n =

Sending Custom User Agents

You can send custom user agent in PHP script using stream context and file_get_contents function. Here is an example: $options = array( 'http'=>array( 'method'=>"GET", 'header'=>"User-Agent: My Custom User Agent Stringrn" ) ); $context = stream_context_create($options); // Replace with your URL $response = file_get_contents('http://example.com', false, $context); This example creates a

File Get Contents the Best Method

function fetchWebPage($url) { // Load the web page content $content = file_get_contents($url); // Check if the content is successfully loaded if ($content === false) { // If the web page doesn't exist, load a local file for error $content = file_get_contents('local_error_file.html'); } else { // Get the base URL $base_url = parse_url($url, PHP_URL_SCHEME) . '://' . parse_url($url, PHP_URL_HOST);

Domain to domain cURL / API restrict page access

You can pass the token using HTTP headers, or via a POST request which will make it invisible in the URL. Using this method the token ID is not present in the URL. Since you are redirecting from one domain to another using a GET request, this leaves the HTTP headers method as your only method to go about implementing this. Please be note that this only works in a server-to-server communication

Domain to domain SQLite restrict page access

Domain 1 controls the database while Domain 2 just acts according to the token verification result. In this scenario, Domain 2 will not directly access the database, but it will make a request to Domain 1 (verifyToken.php) to check whether a given token is valid or not. Domain 1 will return a response accordingly after checking the database, and Domain 2 will then grant or deny access based on

Domain to domain restrict page access

Need to restrict access to a page between domains? If your pages are on the same domain, you can use sessions. But what about two different domains? After much experimenting, I present a simple way to restrict page access between domains without a database. EXAMPLE 1: Code for referring domain: <?php $secretKey = '0101010'; $secondDomainURL = 'https://qikgraphics.com/1/banner/creator.php'; //

Browser Window Notice

This is a cool way to display a notice at the bottom of browser window. Keep in mind there are no advanced settings, and it appears every time window is loaded or refreshed. Here is the basic style: <style type="text/css"> #article-fixed-message-container { position: fixed; bottom: 20px; cursor: pointer; } #article-fixed-message-text { background-color: blue; position: relative; color:

Send a session value from one page to another

To send a session value from one page to another using a URL, you can include the session value as a query parameter in the URL. Here are a few approaches you can use: Append the session value as a query parameter in the URL using PHP: $sessionValue = $_SESSION['session_key']; $url = "../next_page.php?session_value=" . urlencode($sessionValue); In this code, $_SESSION['session_key'] is the