neige d'aoust

knowledge, art, and other stuff

User Tools

Site Tools


urn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
urn [2025/10/12 18:21] – created Yukiurn [2025/10/12 22:34] (current) Yuki
Line 1: Line 1:
-<php> 
-if(isset($_GET['urn'])) 
-{ 
-  $urn = $_GET['urn']; 
-  $resolvers = [ 
-    "urn:example:" => function ($u) { return "https://example.org/".$u; }, 
-  ]; 
-   
-  foreach($resolvers as $key => $value){ 
-    if(str_starts_with($urn, $key)){ 
-      header("Location: ". $value($urn)); 
-      return; 
-    } 
-  } 
-} 
-</php> 
- 
 ====== URN resolver ====== ====== URN resolver ======
 <html> <html>
 <script> <script>
 function register(){ function register(){
-  navigator.registerProtocolHandler("urn", "https://膤.com/urn?urn=%s");+  navigator.registerProtocolHandler("urn", "https://膤.com/urn.php?urn=%s");
 } }
 </script> </script>
 <button onclick=register()>Register URN: protocol</button> <button onclick=register()>Register URN: protocol</button>
 </html> </html>
urn.1760307665.txt.gz · Last modified: by Yuki