Questions about php open paths

Source: Internet
Author: User
Cainiao asks php to open the path and ask for advice. during the practice of leaving a message, & lt; form & nbsp; action2.php & nbsp; methodpost & gt ;.... & lt; input & nbsp; typesubmit & nbsp; value submission & gt; after submission, the page jumps to file: D: wampwwwtest_html2.php. I 'd like to ask you how to solve the php Open path problem.
Ask for advice,

....

After submission, the page jumps to file: // D:/wamp/www/test_html/2.php.

I would like to ask how to change the webpage to localhost/test_html/2.php

When you use the notepad ++ shortcut key, it will also be the file path name. how can you change it to localhost?

------ Solution ----------------------
If you use sublime, modify it as follows:
Sublime Text 2
Sublime Text 3 can be used:


Menu --> Tools --> New Pugin

# Clear the content and add the following code

Import sublime, sublime_plugin
Import webbrowser

Url_map = {
'E: \ phpStudy \ WWW ': 'http: // localhost ',
}

Class OpenBrowserCommand (sublime_plugin.TextCommand ):
Def run (self, edit ):
Window = sublime. active_window ()
Window. run_command ('save ')
Url = self. view. file_name ()
Flag = False
For path, domain in url_map.items ():
If url. startswith (path ):
Url = url. replace (path, domain). replace ('\\','/')
Flag = True
Break
If not flag:
Url = 'File: // '+ url
Webbrowser. open_new (url)



Then save the file. the save path is similar to the following:

C: \ Users \ XXXX \ AppData \ Roaming \ Sublime Text 3 \ Packages \ User \ open_browser.py

XXXX is a Windows 7 system user. you can find this directory through the Sublime menu.

Menu --> Preferences --> Browse Packages click to open the Directory



Note:
E: \ phpStudy \ WWW replace it with the path of the root directory of your Web document


Bind a shortcut key

Menu --> Preferences --> Key Bindings-User

Add the following code:

[{"Keys": ["ctrl + B"], "command": "open_browser"}]

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.