bylletski Posted March 17, 2013 Share Posted March 17, 2013 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> Link to comment https://forums.phpfreaks.com/topic/275769-i-want-the-comments-to-stay/ Share on other sites More sharing options...
Jessica Posted March 17, 2013 Share Posted March 17, 2013 Store the comments in a database. Link to comment https://forums.phpfreaks.com/topic/275769-i-want-the-comments-to-stay/#findComment-1419130 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? Link to comment https://forums.phpfreaks.com/topic/275769-i-want-the-comments-to-stay/#findComment-1419164 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. Link to comment https://forums.phpfreaks.com/topic/275769-i-want-the-comments-to-stay/#findComment-1419171 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.