Thank you for your help !! I want to make it a button under review and click review. It's just that my code won't be implemented. how can I add a button and how can I do it? big brother and big sister can help me !! Score delivery
Reply to discussion (solution)
The information provided is incomplete.
Probably as follows:
The above figure shows the data you read cyclically. 1 indicates that the data has passed the review, and 0 indicates that the data has not been reviewed,
So when you generate a list, you need to add a judgment.
If ($ row ['XXX'] = '1 '){
Echo 'reviewed ';
} Else {
Echo 'review ';
}
It is equivalent to an edited page.
Method 2: Use ajax directly.
The information provided is incomplete.
Probably as follows:
The above figure shows the data you read cyclically. 1 indicates that the data has passed the review, and 0 indicates that the data has not been reviewed,
So when you generate a list, you need to add a judgment.
If ($ row ['XXX'] = '1 '){
Echo 'reviewed ';
} Else {
Echo 'review ';
}
It is equivalent to an edited page.
Method 2: Use ajax directly.
The data circulating above is just the one that you want to add a button on the page for manual review. how can we add it? or I will stick the code here for you to see
Echo'Button'
The value obtained when you click it is uploaded to php using ajax for processing. modifying the data status to 1 indicates that the value has been reviewed. the default value of the core is 0.
Echo'Button'
The value obtained when you click it is uploaded to php using ajax for processing. modifying the data status to 1 indicates that the value has been reviewed. the default value of the core is 0.
Let's take a look at the code. I'm a newbie.
Error_reporting (E_ALL &~ E_NOTICE );
// Session_start ();
// Check whether logon is performed. If no logon is performed, the logon page is displayed.
// If (! Isset ($ _ SESSION ['userid']) {
// Header ("Location: login.html ");
// Exit ();
//}
// Contains the database connection file
Include ('connect. php ');
// $ Userid = $ _ SESSION ['userid'];
// $ Username = $ _ SESSION ['username'];
$ User_query = mysql_query ("select UserName, RealName, Department, PassWord, Email, MyGroup, WorkPhone, HomePhone, MobilePhone, CurrentTime, EndTime, Status from userinfo order by id asc ");
$ Row = mysql_fetch_array ($ user_query );
Echo'
';// Display the field name Echo "\ n
\ N ";Switch (mysql_field_name ($ user_query, $ I )){Case Id:Echo'
'. "ID "; Echo" | \ N ";Case UserName:Echo'
'. "User name "; Echo" | \ N ";Case RealName:Echo'
'. "Real name "; Echo" | \ N ";Case Department:Echo'
'. "Department "; Echo" | \ N ";Case PassWord:Echo'
'. "Password "; Echo" | \ N ";Case Email:Echo'
'. "Email "; Echo" | \ N ";Case MyGroup:Echo'
'. "Group "; Echo" | \ N ";Case WorkPhone:Echo'
'. "Work phone number "; Echo" | \ N ";Case HomePhone:Echo'
'. "Home Phone "; Echo" | \ N ";Case MobilePhone:Echo'
'. "Mobile phone "; Echo" | \ N ";Case CurrentTime:Echo'
'. "Registration time "; Echo" | \ N ";Case EndTime:Echo'
'. "End time "; Echo" | \ N ";Case Status:Echo'
'. "Review "; Echo" | \ N ";} Echo"
\ N "; If (mysql_fetch_row ($ user_query) = "0 "){Echo "no record! ";Exit;} // Locate the first recordMysql_data_seek ($ user_query, 0 );// Retrieve records cyclicallyWhile ($ row = mysql_fetch_row ($ user_query )){Echo"
\ N ";For ($ I = 0; $ I{ Echo'
'; Echo "$ row [$ I]"; Echo' | ';}Echo"
\ N ";} Echo"
\ N ";
// Release resources
Mysql_free_result ($ user_query );
// Close the connection
Mysql_close ();
?>
Error_reporting (E_ALL &~ E_NOTICE );
// Session_start ();
// Check whether logon is performed. If no logon is performed, the logon page is displayed.
// If (! Isset ($ _ SESSION ['userid']) {
// Header ("Location: login.html ");
// Exit ();
//}
// Contains the database connection file
Include ('connect. php ');
// $ Userid = $ _ SESSION ['userid'];
// $ Username = $ _ SESSION ['username'];
$ User_query = mysql_query ("select UserName, RealName, Department, PassWord, Email, MyGroup, WorkPhone, HomePhone, MobilePhone, CurrentTime, EndTime, Status from userinfo order by id asc ");
$ Row = mysql_fetch_array ($ user_query );
Echo'
';// Display the field name Echo "\ n
\ N ";Switch (mysql_field_name ($ user_query, $ I )){Case Id:Echo'
'. "ID "; Echo" | \ N ";Case UserName:Echo'
'. "User name "; Echo" | \ N ";Case RealName:Echo'
'. "Real name "; Echo" | \ N ";Case Department:Echo'
'. "Department "; Echo" | \ N ";Case PassWord:Echo'
'. "Password "; Echo" | \ N ";Case Email:Echo'
'. "Email "; Echo" | \ N ";Case MyGroup:Echo'
'. "Group "; Echo" | \ N ";Case WorkPhone:Echo'
'. "Work phone number "; Echo" | \ N ";Case HomePhone:Echo'
'. "Home Phone "; Echo" | \ N ";Case MobilePhone:Echo'
'. "Mobile phone "; Echo" | \ N ";Case CurrentTime:Echo'
'. "Registration time "; Echo" | \ N ";Case EndTime:Echo'
'. "End time "; Echo" | \ N ";Case Status:Echo'
'. "Review "; Echo" | \ N ";} Echo"
\ N "; If (mysql_fetch_row ($ user_query) = "0 "){Echo "no record! ";Exit;} // Locate the first recordMysql_data_seek ($ user_query, 0 );// Retrieve records cyclicallyWhile ($ row = mysql_fetch_row ($ user_query )){Echo"
\ N ";For ($ I = 0; $ I{ Echo'
'; If ($ I = (mysql_num_fields ($ user_query)-1 )){ Echo $ row [$ I].""; } Else { Echo "$ row [$ I]"; } Echo' | ';}Echo"
\ N ";} Echo"
\ N ";
// Release resources
Mysql_free_result ($ user_query );
// Close the connection
Mysql_close ();
?>
Now there is something on it. could you help me with it? how can I review it? The field in the database is Status. I thought it was to click the button next to it. after review, keep it and modify the database field. the page is reviewed. thank you! I will give you more points.
Write a link as you said!
If ($ I = (mysql_num_fields ($ user_query)-1) {// index. php is equivalent to your current. php file echo"";}Else {echo" $ row [$ I] ";}use this page to receive: if (isset ($ _ GET )) {$ status = $ _ GET ['status']; $ userid = $ _ GET ['userid']; // then write the SQL statement update tablename set status = $ status where userid = $ userid ;}
The above is just to provide you with this idea, the code is not processed, you still need to tune your own in practical use
If ($ I = (mysql_num_fields ($ user_query)-1) {if ($ row [$ I] = 1) {echo 'reviewed';} Else {echo' not reviewed';}} Else {echo "$ row [$ I]";}
If ($ I = (mysql_num_fields ($ user_query)-1) {if ($ row [$ I] = 1) {echo 'reviewed';} Else {echo' not reviewed';}} Else {echo "$ row [$ I]";}
Thank you! Yes, it is. However, there is still a problem in saving the error. Thank you very much.
What kind of form do I want to add a check box in front of? how can I achieve this? can I add your [wzb0712] qq ??
If ($ I = (mysql_num_fields ($ user_query)-1) {if ($ row [$ I] = 1) {echo 'reviewed';} Else {echo' not reviewed';}} Else {echo "$ row [$ I]";}
The eldest brother is not here. please take a look. I am in a hurry. Thank you!
Isn't it easy to add a check box? See the html basics