search
HomeBackend DevelopmentPHP TutorialPlay with virtual domain names◎+_PHP tutorial
Play with virtual domain names◎+_PHP tutorialJul 20, 2016 am 11:04 AM
uInternet accessDiscoverdomain namestartsupplyHave funwebsitevirtual

I don’t know if you have discovered a new phenomenon on the Internet recently, that is, some websites have begun to provide “username@server” virtual domain name services. Due to the charm of "@", everyone is applying one after another. You may be thinking: "How great it would be if I could also provide this kind of service:) It must be very popular!" This article will reveal the "mystery" of "@" to everyone. Veil, so everyone can come "@"! (Do u @ today?)
Don’t worry, this is not an email address, it is a virtual domain name. If you don’t believe it, you can visit “bbs@zphp.com” in your browser. Some friends should have used the FTP function of IE. Just type "password:username@server" in the address bar of the browser and IE will automatically log in to the FTP server; and in the Http1.1 protocol, the Http access authorization function is stipulated. The form is also "password:username@server", in which "password:" can be omitted. Accessing "bbs@zphp.com" actually accesses the server "zphp.com" as bbs.
Then we just need to send the specific URI to the PHP program and search for the real URL redirection in the database.
First we need to create a page that transmits URI (as the default document of the server, usually named index.htm); this function can be implemented in the Window object of JS. The following is the source code of index.htm:
<script> <br />this.location = 'gotourl.php?url=' + this.location.href; <br /></script>
The above code will redirect the browser to gotourl .php, and assign the variable $url to the current URI through QueryString.
After successfully passing the URI to the PHP program, you can enter the database to find the real URL. The following is the structure of the table corresponding to the SQL database:
CREATE TABLE domain(
Id int(3) UNSIGNED DEFAULT '0 ' NOT NULL, # Domain name ID
Domain char(20) NOT NULL, # Domain name
Gotourl char(255) NOT NULL, # Real URL
);
Once the Table is created, you can Start writing gotourl.php. The program is divided into three parts:
1. Analyze URL:
$url = preg_replace(“/^http:///I”, “”, $url); // Remove the "http://" in front of the URL, it is not case sensitive
$url = preg_replace("/@.+$/", "", $url); // Remove the part after the "@"
Then, the remaining URL only contains the "username" part.
In order to apply to the database, the characters need to be processed:
$url = addslashes($url);
2. Search for the real URL:

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445234.htmlTechArticleI don’t know if you have discovered a new phenomenon online recently, that is, some websites have begun to provide virtual domain name services for username@server . Because of the charm of @, everyone is applying, you may think...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Microsoft Wi-Fi 直连虚拟适配器:它有什么作用?Microsoft Wi-Fi 直连虚拟适配器:它有什么作用?Jun 29, 2023 pm 12:33 PM

您可能想知道MicrosoftWi-Fi直接虚拟适配器在您的PC上的作用。最好放心,此网络适配器Microsoft且完全安全。但是,如果适配器弄乱了您的活动,并且您想知道它是否值得保留,本指南将为您提供您需要了解的所有信息。MicrosoftWi-FiDirect虚拟适配器有什么作用?顾名思义,MicrosoftWi-Fi直接虚拟适配器有助于使您的PC成为无线热点。这样,其他计算机可以连接到您的PC以访问互联网。它通过虚拟化无线网络适配器来实现此目的。这样,您的单个物理无线适配器将转换为两个虚拟

CS玩家的首选:推荐的电脑配置CS玩家的首选:推荐的电脑配置Jan 02, 2024 pm 04:26 PM

1.处理器在选择电脑配置时,处理器是至关重要的组件之一。对于玩CS这样的游戏来说,处理器的性能直接影响游戏的流畅度和反应速度。推荐选择IntelCorei5或i7系列的处理器,因为它们具有强大的多核处理能力和高频率,可以轻松应对CS的高要求。2.显卡显卡是游戏性能的重要因素之一。对于射击游戏如CS而言,显卡的性能直接影响游戏画面的清晰度和流畅度。建议选择NVIDIAGeForceGTX系列或AMDRadeonRX系列的显卡,它们具备出色的图形处理能力和高帧率输出,能够提供更好的游戏体验3.内存电

主机的域名和主机的ip地址两者之间的关系是什么主机的域名和主机的ip地址两者之间的关系是什么Jan 14, 2021 pm 06:02 PM

主机的域名和主机的ip地址两者之间的关系是:一个IP地址对应多个域名。IP地址用数字化形式来对计算机网络中的主机进行网络标识,域名用字符化形式来对计算机网络中的主机进行网络标识。在Internet中,一个域名之内能够对应一个IP地址,但是一个IP地址可以被多个域名所对应。

25个AI智能体源码现已公开,灵感来自斯坦福的「虚拟小镇」和《西部世界》25个AI智能体源码现已公开,灵感来自斯坦福的「虚拟小镇」和《西部世界》Aug 11, 2023 pm 06:49 PM

熟悉《西部世界》的观众都了解,这部剧设定在未来世界的一个巨大高科技成人主题乐园中,机器人们具备与人类相似的行为能力,能够记忆所见所闻,重复核心故事情节。每天,这些机器人都会被重置,回到初始状态在斯坦福论文《GenerativeAgents:InteractiveSimulacraofHumanBehavior》发布后,这种情景不再仅限于影视剧中,AI已经成功复现了这一场景Smallville的「虚拟小镇」概览图论文地址:https://arxiv.org/pdf/2304.03442v1.pdf

请求的控件无效 NET HELPMSG 2191:2 个简单修复请求的控件无效 NET HELPMSG 2191:2 个简单修复Apr 15, 2023 am 09:13 AM

在TCP/IP协议套件中,域名系统是提供计算机名称到IP地址映射名称解析服务的协议之一。但是,有时它会出现故障,从而导致错误,例如请求的控制对此服务NETHELPMSG2191无效。DNS客户端和服务器协同工作,为计算机和用户提供计算机名称到IP地址映射名称解析服务。安装Windows后,客户端和服务器版本的操作系统默认启用客户端服务。一旦您在TCP/IP网络配置中指定了服务器的IP地址,DNS客户端就会查询服务器以发现域控制器并将计算机名称解析为IP地址。只有在服务

国内永久免费域名申请方法是什么国内永久免费域名申请方法是什么Jan 19, 2024 pm 04:01 PM

申请方法:1、通过工信部网站申请免费域名,等待审核通过后即可获得免费域名;2、通过DNSPod免费申请域名,用户可以在DNSPod上注册账号并申请免费的二级域名;3、选择一个可靠的免费域名服务提供商,通过对比和了解,选择一个可靠的提供商;4、注册账号,点击注册按钮,按照要求填写相关个人信息并创建账号;5、搜索并选择域名即可。

使用域名访问网站是啥意思使用域名访问网站是啥意思Mar 10, 2023 pm 02:18 PM

使用域名访问网站是指使用域名来进入一个网站,就是在浏览器里直接输入网站的网址来访问网站。网站都是存放在服务器上的,服务器有一个地址,也就是网站的ip地址,是一串数字,但是数字很难记,域名和DNS应用而生,DNS就是将网址和网站的ip地址对应起来;这样用户可以输入网址(域名),就相当于输入了网站的ip地址,就可以访问网站了。

Discuz域名修改操作指南Discuz域名修改操作指南Mar 09, 2024 pm 04:36 PM

Discuz域名修改操作指南在使用Discuz论坛系统的过程中,有时候我们需要修改论坛的域名。可能是因为需要更换域名,或者是修复一些域名解析的问题。本文将为大家详细介绍如何在Discuz论坛系统中进行域名修改操作,并给出一些具体的代码示例。1.备份数据在进行任何操作之前,我们都要先备份数据,以防止因操作失误导致数据丢失。在Discuz中,可以使用后台的数据备

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),