Get the HTML file address for an issue

Source: Internet
Author: User
Problems getting the address of an HTML file
1. An HTML file to send data through the table one-way php file, how to know the file name of the HTML file in the PHP file (is the filename, for example, hello.html)
2.php file output data (Ajax included in HTML file) to an HTML file through Ajax, how to learn the file name of the HTML file in PHP files

Suddenly think of these two questions, ask you the great God, this is the problem of the solution does not

------Solution--------------------
1,
①referer
② when generating HTML forms, hide a single input
③ setting a cookie record URL when accessing an HTML page
④ use session record URL when accessing HTML page

2,
What does a php file do with Ajax?
------Solution--------------------
1. If you pass the name of the file, then of course you know, otherwise you will not know.
2. If 1

------Solution--------------------
Two problems can be merged. The browser appears to be accompanied by a referer in the head header while the form is being submitted. So that you can pass
$_server[' Http_referer ' to get the file name of the originating request.
For example
PHP Code
if (Isset ($_server[' http_referer ')) {    $urlinfo = Parse_url ($_server[' http_referer ']);    $filename = basename ($urlinfo [' path ');} I'm not sure if that's what all browsers do.
------Solution--------------------
  • Related Article

    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.