How to write the same page pass value in php

Source: Internet
Author: User
How to write the same page transfer value in php? What is the result I want? & lt; table & gt; & nbsp; & lt ;? Php $ I = 1; & nbsp; do {? & Gt; & lt; tr & gt; // Title & lt; td & gt; & lt; ahref = & quot; default_task_edi php?
What I want is








Do {?> // Title } While ($ row_Recordset_task = mysql_fetch_assoc ($ Recordset_task ));?>
">



// The content related to the title is displayed here. The value of the content in and database is $ row_Recordset_task ['CSA _ text']





------ Solution --------------------
If you don't want to refresh the page, you can use ajax or the stupid method to create a new page with the same style as the original page to jump to this new page. the new page is visually similar to the original interface, as if it was not refreshed.
------ Solution --------------------
Agree to use ajax upstairs !!!
------ Solution --------------------
PHP code
  Error :". mysql_error (); if (mysql_affected_rows ()> 0) {$ titles = array (); while ($ rows = mysql_fetch_array (MYSQL_ASSOC) {array_push ($ titles, $ rows) ;}}?>
  
) ">
Script // Ajaxvar xmlHttp; function createXMLHttpRequest () {if (window. XMLHttpRequest) {xmlHttp = new XMLHttpRequest ();} else if (window. activeXObject) {xmlHttp = new ActiveXObject ("Microsoft. XMLHTTP ") ;}} function record (id) {createXMLHttpRequest (); url =" action. php? Id = "+ id +" & ran = "+ Math. random (); method = "GET"; xmlHttp. open (method, url, true); xmlHttp. onreadystatechange = showList; xmlHttp. send (null);} function show () {if (xmlHttp. readyState = 4) {if (xmlHttp. status = 200) {var text = xmlHttp. responseText; document. getElementById ("show "). innerHTML = text;} else {alert ("response error code:" + xmlHttp. status) ;}} script Error: ". mysql_error (); if (mysql_affected_rows ()> 0) {$ rows = mysql_fetch_array (MYSQL_ASSOC);} print_r ($ rows); mysql_close ();}?>
------ Solution --------------------
Learned Discussion

PHP code

/* Created on [2012-5-16] Author [yushuai. niu] */
# Querying title information
$ SQL = "select * from table ";
$ Res = mysql_query ($ SQL );
If (! $ Res) die ("SQL: {$ SQL}
Error: ". mysql_error ());
If (mys ......

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.