bylletski Posted March 17, 2013 Share Posted March 17, 2013 (edited) Hello i created a code today who works very good. But there is 1 one problem i can't figure out. I want all the comments to stay on the site.Like this if i comment Hey and then hello i want Hey and Hello stay one the screen.But when i comment now It's be like this. I first comment Hey and It's stay one the screen. Then I comment Hello that will make Hey disappear and Hello stays on the screen. I want them both to stay on the screen. <?phperror_reporting(E_ALL ^ E_NOTICE);echo "Comments<br><br><br>";$name = $_POST['name'];$comment = $_POST['comment'];if(isset($_POST['button'])) {echo "Comment by<br>";echo 'Name: ' . $name = $_POST['name'];echo '<br>';echo 'Comment: ' . $comment = $_POST['comment'];echo '<br>';}?><form method="post" action="new.php">Name:<br><input type="text" name="name"><br><br>Comment:<br><input type="text" name="comment" size="60" height="100"><input type="submit" name="button" value="Comment"> </form> Edited March 17, 2013 by bylletski Quote Link to comment Share on other sites More sharing options...
Jessica Posted March 17, 2013 Share Posted March 17, 2013 Store the comments in a database. Quote Link to comment Share on other sites More sharing options...
bylletski Posted March 17, 2013 Author Share Posted March 17, 2013 Yeah why not! But is there a more a simple without using database? Quote Link to comment Share on other sites More sharing options...
Jessica Posted March 17, 2013 Share Posted March 17, 2013 Write to a file I guess. A database is the right way. Unless you only want it to be there for the time you're on the site, then you'd use a session. You didn't ask a very good question. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.