PHP short URL Super simple code
System environment:
Php,apache2,linux
To generate the PHP short URL operation:
Copy the code to index.php in a two-level directory with only 1 characters (such as U) as the folder name.
To add write permissions for this directory, the diagram chmod 777 U (root directory also line, in ord
This article mainly introduces the code for generating a php short URL (similar to Weibo short URL ), for more information, see the next article. This article mainly introduces the code generated for a php short URL (similar to a Weibo s
Code generated for a php short URL (similar to a Weibo short URL ). Share the code generated for a php short URL. Copy the code as follows :! The DOCTYPEhtmlhtmlheadmetacharsetutf-8titleurlShorttitleheadbodyformactionurlShort.p sh
This article mainly introduces the code generated for a php short URL (similar to a Weibo short URL). For more information, see
This article mainly introduces the code generated for a php short URL (similar to a Weibo short URL).
In recent years, the use of two-dimensional code more and more wind, the author recently on hand also encountered a need to use two-dimensional code to scan the site's live, so the study of this set of mechanisms, and code to achieve the entire process, and then we chat about two-dimensional code login and those things
Php generates code for a short URL, similar to a microblog short URL
UrlShort-php generate short URL _ bbs.it-home.org _ script School provides
2. Generate the php short
Share the code generated for a php short URL.Copy codeThe Code is as follows:Header ("Content-Type: text/html; charset = UTF-8 ");Function base62 ($ x ){$ Show = '';While ($ x> 0 ){$ S = $ x % 62;If ($ s> 35 ){$ S = chr ($ s + 61 );} Else if ($ s> 5 $ S $ S = chr ($ s + 55 );} Www.jbxue.com$ Show. = $ s;$ X = floor ($ x/62 );}Return $ show;}// Generate a
urlshort-php Generate short URLs _bbs.it-home.org_ Scripting Academy offers
Copy Code2, generate code for PHP short URLs.
Header ("Content-type:text/html;charset=utf-8");
function base62 ($x) {
$show = ";
while ($x >0) {
$s = $x% 62;
if
Original: Java Swing development of short and concise Tetris game source code download, only 300 lines of codeSource code: Http://www.zuidaima.com/share/1550463495146496.htmJava Swing development of short and short Tetris game source cod
Ideas:
1) will be long Web site MD5 generated 32-bit signature string, divided into 4 paragraphs, 8 bytes per paragraph;
2 to the four-segment loop, take 8 bytes, consider him as 16-string and 0X3FFFFFFF (30-bit 1) and operation, that is, more than 30-bit ignore processing;
3 The 30 bits are divided into 6 segments, each 5 digit number is taken as the index of the alphabet to obtain the specific characters, and then the 6-bit string is obtained.
4) The total MD5 string can obtain 4 6-bit strings
The code is as follows
Copy Code
Sina App_keyDefine (' Sina_appkey ', ' 31641035 '); function Curlquery ($url) {Set additional HTTP Headers$addHead = Array ("Content-type:application/json"); Initialize curl, of course, you can also use Fsockopen instead$curl _obj = Curl_init (); Set up URLscurl_setopt ($curl _obj, Curlopt_url, $url); Additional head contentcurl_setopt ($curl _obj, Curlopt_h
. Adding related permissions
So how to get the relevant content of SMS?
2. How to get the relevant content of the SMS just received.
In general, the validation of SMS is sent directly to the user in the form of a new text message, then the application will need to have the relevant listening event if it thinks of reading the short content just received. I do this by using Contentobserver. By using this class, you can capture a specifi
Principle:
1. The original URL do crc32 check, get the check code.
2. Use sprintf ('%u ') officers transferred Guevara code to convert to unsigned digits.
3.62 Operations for unsigned digits (uppercase and lowercase + digits equal to 62 digits), the remainder is mapped to 62 characters, and the mapped characters are saved. (for example, the remainder is 10, then the mapped character is a,0-9 corresponds
The 1th chapter beginner of Small procedure2nd. Basic component learning for small programsThe 3rd Chapter forms the form component and the small program front and back end communicationThe 4th Chapter introduction of product introduction and database planning5th Chapter Development User Login registration and user information6th Chapter Upload Video Business process development7th chapter Development of Video Presentation pageThe 8th chapter develops the video message boardThe 9th chapter devel
If the following is a list of links to your video site, if people want to crawl your data is very easy, see the rules will know that the database is a sequential increase
Http://www.xxxx.com/video/1Http://www.xxxx.com/video/2Http://www.xxxx.com/video/3
So to solve this problem, we can use the short address, do not expose the real link, using symmetric encryption is a good solution.
Hashids is a good choice, it provides the implementation of Js/php/
Related reading:
Based on jquery to send the short message verification code after the countdown function (ignoring the page off)
The following section of code is a small series of JS sent to you to send SMS verification code after the countdown function, the code is simpl
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.