玩转虚拟域名◎+
不知道大家最近上网是否发现一个新现象,就是有一些网站开始提供“username@server”的虚拟域名服务。由于“@”的魅力,大家纷纷申请,你或许会想:“如果我也能提供这种服务,该多好阿:)人气肯定不错!”本文将给大家揭开“@”的“神秘”面纱,让大家都可以来“@”!(Do u @ today?)
别急,这个并不是电子邮件的地址,是一种虚拟域名,不相信的话可以在浏览器中访问“bbs@zphp.com”。部分朋友应该使用过IE的FTP功能,就是在浏览器的地址栏中键入“password:username@server”IE就会自动登陆FTP服务器;而在Http1.1协议中,就规定了Http访问授权功能,形式同样为“password:username@server”,其中“password:”可以省略,也是是访问“bbs@zphp.com”实际上是以bbs的身份访问“zphp.com”这个服务器。
那么我们只是需要将具体的URI传送给PHP程序,在数据库中搜索出真实的URL重定向就可以了。
首先我们需要制作一个传送URI的页面(作为服务器的默认文档,一般命名为index.htm);在JS的Window对象中就可以实现这项功能,下面是index.htm的源代码:
<script> <br />this.location = ‘gotourl.php?url=’ + this.location.href; <br /></script>
上面的代码会将浏览器重定向到gotourl.php,并且通过QueryString给变量$url赋值为当前的URI。
成功将URI传递给PHP程序后,就可以进入数据库查找真实URL,下面是SQL数据库相对应的table 的结构:
CREATE TABLE domain(
Id int(3) UNSIGNED DEFAULT ‘0’ NOT NULL, # 域名ID
Domain char(20) NOT NULL, # 域名
Gotourl char(255) NOT NULL, # 真实的URL
);
建立好了Table,就可以开始编写gotourl.php了,程序分为三个部分:
1、 分析URL:
$url = preg_replace(“/^http:///I”, “”, $url); // 将URL前面的“http://”去掉,不区分大小写
$url = preg_replace(“/@.+$/”, “”, $url); // 将“@”后面的部分去除
那么,剩下的URL就只含有“username”的部分了。
为了给数据库应用,需要对铭感的字符进行处理:
$url = addslashes($url);
2、 搜索真实的URL:

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Websites for learning C language: 1. C Language Chinese Website; 2. Rookie Tutorial; 3. C Language Forum; 4. C Language Empire; 5. Script House; 6. Tianji.com; 7. Red and Black Alliance; 8, 51 Self-study network; 9. Likou; 10. C Programming. Detailed introduction: 1. C language Chinese website, which is a website dedicated to providing C language learning materials for beginners. It is rich in content, including basic grammar, pointers, arrays, functions, structures and other modules; 2. Rookie tutorials, This is a comprehensive programming learning website and more.

1. Use the win+x shortcut key to open the menu and select [Command Prompt (Administrator) (A)], as shown below: 2. After entering the command prompt interface, enter the [ipconfig/flushdns] command and press Enter , as shown in the figure below: 3. Then enter the [netshwinsockresetcatalog] command and press Enter, as shown in the figure below: 4. Finally enter the [netshintipreset] command and press Enter, restart the computer and you can access the Internet, as shown in the figure below:

Some friends find that their computers cannot access the Internet because of abnormal network card drivers. They want to know how to fix it. In fact, current systems have built-in driver repair functions, so we only need to manually update the driver. If it doesn’t work, then we can fix it. Driver software can be used. How to fix the problem that the network card driver is abnormal and cannot connect to the Internet: PS: If this problem occurs suddenly, you can try restarting the computer first. If it still doesn't work after restarting, continue with the following operations. Method 1: 1. First, right-click on the taskbar and select "Start Menu" 2. Open "Device Manager" in the right-click menu. 3. Click "Network Adapter", then select "Update Driver" and click "Automatically search for driver". After the update is completed, you can surf the Internet normally. 5. Some users are also affected by the problem.

When some friends are browsing the web, they find that their computer browser is obviously connected to the Internet but cannot open the web page. What is going on? Let's take a look at the solution to this problem. Win11 browser cannot open web pages but can access the Internet: 1. First click on the "three dots" of the browser. 2. Then click "View advanced settings". 3. Then select "Open proxy settings". 4. Finally, just turn on "Automatically detect settings". Extension: How to set compatibility mode

Application method: 1. Apply for a free domain name through the Ministry of Industry and Information Technology website, and you can obtain the free domain name after waiting for approval; 2. Apply for a domain name for free through DNSPod. Users can register an account on DNSPod and apply for a free second-level domain name; 3. Choose a reliable domain name Free domain name service providers, choose a reliable provider through comparison and understanding; 4. Register an account, click the registration button, fill in the relevant personal information as required and create an account; 5. Search and select the domain name.

Discuz Domain Name Modification Operation Guide In the process of using the Discuz forum system, sometimes we need to modify the domain name of the forum. It may be because the domain name needs to be changed, or some domain name resolution problems need to be repaired. This article will introduce in detail how to modify the domain name in the Discuz forum system, and give some specific code examples. 1. Back up data Before performing any operation, we must back up the data to prevent data loss due to operational errors. In Discuz, you can use the background data backup

1. Choose an available domain name: The corporate email domain name should be related to the corporate brand or business. 2. Check whether the domain name has been registered: After selecting the corporate email domain name, you need to check whether the domain name has been registered by other companies. 3. Choose an email service provider: Enterprises can search for different email service providers through search engines and choose a provider based on their needs. 4. Create an account: The process of registering for an email service may be slightly different, but you usually need to fill in the basic information of the company and administrator and create an administrator account.

What should I do if Sogou High-speed Browser cannot access the Internet? When we use Sogou Browser, we cannot access the Internet. What should we do? Let’s introduce it below! We usually use Sogou Browser to browse the web, which is very convenient. However, recently some friends found that they could not access the Internet while using it. How should this situation be solved? What is the specific operation method? The editor has compiled it below How to solve the problem of Sogou high-speed browser being unable to access the Internet? If you don’t know how to solve it, follow me and take a look below! Solution to Sogou High-speed Browser unable to access the Internet 1. First, open "Sogou High-speed Browser" and click the "Menu Bar" above 2. Then click to expand "More Tools" 3. Next, click "Browser Repair" below 4. Finally Click on Quick Fix
