Search engine Optimization Two ways to interact with PHP and JavaScript

Source: Internet
Author: User
How to make the foreground page and the page in the process of page creation without refreshing the pages
It's always a problem to keep an interactive background CGI page. Here are two I put in practice
The method used.
Method One: Interact with cookies. There are altogether three documents, respectively:
Index.htm,action.php,main.htm
Principle for foreground page main.htm and background action.php via page frame
Index.htm organized and set the page width of the action.php to 0, which does not
affect the display. Action.php the information into a cookie, main.htm by reading
Cookies to enable interaction. The main.htm can also be re-read by action.php
To implement control of the background CGI program.
Index.htm
---------------------------------------------------------------


<title>Test</title>





&lt;noframes&gt;&amp;lt;br&amp;gt; &amp;lt;body bgcolor= "#FFFFFF" &amp;gt; &amp;lt;br&amp;gt; &amp;lt;p&amp;gt; page frames are used, but not supported by your browser. &amp;lt;/p&amp;gt; &amp;lt;br&amp;gt; &amp;lt;/body&amp;gt; &amp;lt;br&amp;gt;&lt;/noframes&gt;

---------------------------------------------------------------
action.php
---------------------------------------------------------------
Srand (Double) microtime () *1000000);
$result =rand (0,100);
Setcookie ("Action", $result, Time () +900, "/");
?>
---------------------------------------------------------------
Main.htm
---------------------------------------------------------------


<title>Test</title>








Re-reading Cookies


---------------------------------------------------------------
Method Two: Directly through the parent.*.* to realize the interaction. There are altogether three documents, respectively:
Index.htm,action.php,main.htm, where index.htm is the same as in front.
Principle for direct transmission via Parent.rightFrame.test.current_cookie.value
Information.
action.php
---------------------------------------------------------------
Srand (Double) microtime () *1000000);
$result =rand (0,100);
?>

---------------------------------------------------------------
Main.htm
---------------------------------------------------------------


<title>Test</title>






Re-reading Cookies


---------------------------------------------------------------

The above describes the search engine optimization PHP and JavaScript two ways to interact, including the search engine optimization aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • 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.