Post a reply after a click to return to the Post list page is not back to what happened?

Source: Internet
Author: User
I do a paste effect on the Post content page Click Back can be directly back to the Post list page but if the reply content after the point returned but not back to the Post list page need another point to go back if you submit two replies you need to press three times to return to the Post list page the more you need to return the number of replies What's going on here?


Reply to discussion (solution)

Don't see the code, it's hard to say

Don't see the code, it's hard to say


Is that the code that you've been asking for the last few days?

If you are using form form, after submission is equivalent to enter a new page, point to return or the original page
The Ajax asynchronous commit will do what you want.

So many posts, which one knows who to whom

So many posts, which one knows who to whom


It's the following code. This is the Post home page is to submit content on this page once click Back not to the Posts list page

tieba3.php
;



<title></title>




Include "cookie.php";
?>



$pdo =new PDO ("Mysql:host=localhost;dbname=t1", "Root", "");
$title =$_get[' id '];
$stmt = $pdo->prepare ("Select Id,title,content from topic where id=?");
$stmt->execute (Array ($title));
$res = $stmt->fetchall (PDO::FETCH_ASSOC);
foreach ($res as $v) {
Echo '. $v [' content ']. ';
}
?>
$pdo =new PDO ("Mysql:host=localhost;dbname=t1", "Root", "");
$id 2=$_get[' id '];
$stmt = $pdo->prepare ("Select id,reid,content from reply where reid=?");
$stmt->execute (Array ($id 2));
$res 1= $stmt->fetchall (PDO::FETCH_ASSOC);
foreach ($res 1 as $v 2) {
echo $v 2[' content ';
}
?>








tieba4.php
if (Isset ($_post[' Reid ')) {
$pdo =new PDO ("Mysql:host=localhost;dbname=t1", "Root", "");
$STNT = $pdo->prepare ("insert into reply (reid,name,content) VALUES (: reid,:name,:content)");
$stnt->execute ($_post);
Header ("location:http://localhost/tieba3.php?id=". $_post[' Reid ');
}
?>

Header ("location:http://localhost/tieba3.php?id=". $_post[' Reid ');
And tieba3.php is obviously a content page, not a list page.

Header ("location:http://localhost/tieba3.php?id=". $_post[' Reid ');
And tieba3.php is obviously a content page, not a list page.



Yes, it's just a page that's inserted into the database. Replies submitted to the current page after submission and displayed is a page such as I post a reply I want to return to the Post list page click a Back button but not back to the Post list page

Do you have to change tieba3.php to a list page program file?

Do you have to change tieba3.php to a list page program file?


That would change the effect.

If you are using form form, after submission is equivalent to enter a new page, point to return or the original page
The Ajax asynchronous commit will do what you want.



I don't understand asynchronous commits, so I don't know how it works, not knowing if it's the effect I want.

3 floor people have answered you, if you point to the browser's return of course back to the previous page-that is, the page before you submit. If you click on your own Write back button, that is the return button of the jump link is not correct

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