Skip to main content
#! code
Main navigation
Articles
Snippets
Tools
About
Contact
User account menu
Log in
Breadcrumb
Home
Search Results
Search Results
Snippet
Posted: 19 Jan 2023
Use PHP Curl To Get Header Data From A Web Page
… // Initialise c
url
. $ch = c
url
_init(); $
url
= 'https://www.hashbangcode.com/'; // Setup c
url
to fetch the headers. c
url
_setopt($ch, C
URL
OPT_
URL
, $
url
); … Use PHP C
url
To Get Header Data From A Web Page …
Snippet
Posted: 7 May 2024
Reverse parse_url() PHP Function
… This function does the opposite process of the parse_
url
() function in PHP. It converts the full array of components back into a
URL
string. /** * Generate
URL
from its components. * * This is essentially the opposite of … Reverse parse_
url
() PHP Function …
Snippet
Posted: 3 Jan 2023
Drupal 10: Generate A Link On The Fly
… The equivalent in Drupal 8+ is the Link class. use \Drupal\Core\Link; $
url
=
Url
::fromUri('route:user.logout'); $link = new Link(t('Logout'), $
url
); There are a number of static helper methods that can generate the …
Snippet
Posted: 1 Jan 2025
Click To Select And Copy Text In JavaScript
… to allow users to easily copy. <div> <p> <input class="js-referral-
url
" type="text" readonly="readonly" … and the content copied. window.onload = function () { const share
Url
= document.querySelector(".js-referral-
url
"); const copyContent = async () => { try { await …
Snippet
Posted: 18 Jan 2023
Curl Command To Test Web Page Response Headers
… c
url
-sSLIXGET http://www.hashbangcode.com To explain: -s flag will make c
url
silent. -S flag (capital s) will show any errors produced (if things fail). -L flag allows c
url
to look for and follow redirects. -I flag (lower case L) tells c
url
… C
url
Command To Test Web Page Response Headers …
Snippet
Posted: 4 Mar 2023
Curl Command To Send Data In A File To A Form
… c
url
-i -X POST -H "Content-Type: application/x-www-form-
url
encoded; charset=UTF-8" -d @testc
url
.txt "http://www.example.com/someform.php" The contents of the file testc
url
.txt will be posted to the form. … C
url
Command To Send Data In A File To A Form …
Snippet
Posted: 19 Jan 2023
Sending An HTTP HEAD Request With Curl
… Use the -I flag (capital i). c
url
-I https://www.hashbangcode.com/ Use the --head flag. c
url
--head https://www.hashbangcode.com/ … Sending An HTTP HEAD Request With C
url
…
Snippet
Posted: 20 Jan 2023
Drupal 7: SQL Query To Print A List Of The URL Alias Created For Nodes And Users
… IS NOT NULL THEN n.type ELSE 'user' END AS 'type', ua.alias FROM
url
_alias ua LEFT JOIN node n ON n.nid = REPLACE(ua.source, 'node/', … Drupal 7: SQL Query To Print A List Of The
URL
Alias Created For Nodes And Users …
Snippet
Posted: 10 Apr 2025
Drupal 11: Wrapping A Link In A HTML Element
… 'p', 'child' => [ '#type' => 'link', '#title' => $this->t("Home."), '#
url
' =>
Url
::fromRoute('<front>'), ], ]; This will render something like this: …
Snippet
Posted: 9 Feb 2023
Drupal 10: A List Of Core Contexts
… @language.current_language_context:language_
url
Provided by …