Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Validate Links

Posted on August 15, 2013October 26, 2015 By David Kittell
function validatelink($link)
{
// Create a curl handle to a location
$ch = curl_init($link);

curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_NOBODY, true);

if (curl_exec($ch) === false) {
    echo 'INVALID: ' . $link . " " . curl_error($ch);
}
else
{
    echo 'VALID: ' . $link;
}

// Close handle
curl_close($ch);
}

Example
“;
OP2validatelink(“http://kittell.net.com”);
?>

Originally Posted on August 15, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code PHP

Post navigation

Previous post
Next post

Related Posts

PowerShell – Compare Windows Server Host Files

Posted on February 10, 2020

If you maintain more than one Windows server sometimes you need a quick way to determine the host file differences on each server, the code below will help. function Read-HostFile() { [CmdletBinding()] Param( [Parameter(Mandatory = $True)] [String] $Computer, [boolean] $ListComputerName = $true ) $Pattern = ‘^(?<IP>\d{1,3}(\.\d{1,3}){3})\s+(?<Host>.+)$’ $File = "\\$Computer\c$\Windows\System32\Drivers\etc\hosts" $Entries…

Read More

C# Application Form Closing Event Question

Posted on March 23, 2014October 26, 2015

Sometimes you have a program that you would prefer someone not close without confirming they truly meant to close it. This script will assist in providing a question before the program simply closes. private void fm1_FormClosing(object sender, FormClosingEventArgs e) { DialogResult dialogResult = MessageBox.Show("Are you sure you want to close?",…

Read More

Delete Ektron User

Posted on July 29, 2013October 26, 2015

In order to force a deletion from the Ektron user list you must follow the below path. DISCLAIMER: This will remove all content that was ever created/touched by the user. –Permissions Table DELETE permissions_tbl FROM permissions_tbl INNER JOIN users ON permissions_tbl.user_id = users.user_id WHERE users.user_name = ‘dkittell’ –Group Table DELETE…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories
  • Raspberry Pi - Remove Default Apps
  • PowerShell - Change Windows CD/DVD Drive Letter
©2025 David Kittell | WordPress Theme by SuperbThemes