Why can't I return to the post list page after I submit a reply to this code and click the return key?

Source: Internet
Author: User
It is similar to the effect of SF. We click a title on the post list page to enter the topic of this post. After submitting a reply in the topic, click the back button of the browser and return it to the post. the list page is displayed, but I have a bug in this effect. If you do not submit a reply, click it once... it is similar to the effect of SF. We click a title on the post list page to enter the topic of this post. After submitting a reply in the topic, click the back button of the browser and return it to the post. the list page is displayed, but I have a bug in this result. If you do not submit a reply point once, you can return to the post list page. After submitting a reply, you need to click the return button twice to return to the post list page. if you submit two replies in this post, you need to click the return button three times to return to the post list page. Why?

This is the topic page tieba3.php of the post.


  ;        

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'].''; } ?> prepare("select id,reid,content from reply where reid=?"); $stmt->execute(array($id2)); $res1=$stmt->fetchall(PDO::FETCH_ASSOC); foreach($res1 as $v2){ echo $v2['content']; } ?>

Tieba4.php


  prepare("insert into reply(reid,name,content)values(:reid,:name,:content)"); $stnt->execute($_POST);header("location:http://localhost/tieba3.php?id=".$_POST['reid']);}?>

Reply content:

It is similar to the effect of SF. We click a title on the post list page to enter the topic of this post. After submitting a reply in the topic, click the back button of the browser and return it to the post. the list page is displayed, but I have a bug in this result. If you do not submit a reply point once, you can return to the post list page. After submitting a reply, you need to click the return button twice to return to the post list page. if you submit two replies in this post, you need to click the return button three times to return to the post list page. Why?

This is the topic page tieba3.php of the post.


  ;        

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'].''; } ?> prepare("select id,reid,content from reply where reid=?"); $stmt->execute(array($id2)); $res1=$stmt->fetchall(PDO::FETCH_ASSOC); foreach($res1 as $v2){ echo $v2['content']; } ?>

Tieba4.php


  prepare("insert into reply(reid,name,content)values(:reid,:name,:content)"); $stnt->execute($_POST);header("location:http://localhost/tieba3.php?id=".$_POST['reid']);}?>

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.