Hi everyone, i'm newbie here just want to catch some knowledge here, i just wondering to know how to make link like mediafire download link, such as
is that using .htaccess editing?
thanks
Hi everyone, i'm newbie here just want to catch some knowledge here, i just wondering to know how to make link like mediafire download link, such as
is that using .htaccess editing?
thanks
No need to touch .htaccess for this — .htaccess is for URL rewriting/redirects, not turning pasted text into anchors. was right to suggest pattern matching; below is a compact, safe PHP helper that builds clickable links from http/https text, preserves trailing punctuation, and avoids XSS. Posting this here for and anyone else who wants the code.
<?php
function autolink($text) {
// Split text so URL parts are captured
$parts = preg_split('~(https?://[^\s<]+)~i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
foreach ($parts as $i => $part) {
if ($i % 2 === 0) {
// non-URL fragments: escape
$parts[$i] = htmlspecialchars($part, ENT_QUOTES, 'UTF-8');
} else {
// URL fragment: trim trailing punctuation, build safe anchor
$url = rtrim($part, ".,;:!?)]}'\"");
$trail = substr($part, strlen($url));
$href = htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
$label = htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
$parts[$i] = '<a href="' . $href . '" target="_blank" rel="noopener noreferrer">' . $label . '</a>' . $trail;
}
}
return implode('', $parts);
} Notes and tips:
Jump to Post— vaibhav1983 1you can do a pattern matching in strings. Whenever somebody pastes a link in your textbox. Search for http:// and replace that text with <a href="<the-link>">the-link</a>
I guess this might help...If not...send me a PM, I'll send you the PHP code.
you can do a pattern matching in strings. Whenever somebody pastes a link in your textbox. Search for http:// and replace that text with <a href="<the-link>">the-link</a>
I guess this might help...If not...send me a PM, I'll send you the PHP code.
you can do a pattern matching in strings. Whenever somebody pastes a link in your textbox. Search for http:// and replace that text with <a href="<the-link>">the-link</a>
I guess this might help...If not...send me a PM, I'll send you the PHP code.
Plz Send The Code Here So It Will Help Everyone
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.