bobleny Posted June 17, 2006 Share Posted June 17, 2006 I am creating a PHP forum (I know, why recreate the wheel?) and I have an edit post option. Currently I have it set up with:[code]<form action='forum_edit_1.php' method='post'><input type="hidden" name="message" value="<?php echo $message ?>"><input type="hidden" name="id" value="<?php echo $id ?>"><input type='Submit' value='Edit'></form>[/code]It has to write the message twice for each post even if it isn’t going to be edited.Is there a better way of editing posts? What do you recommend for this? Quote Link to comment https://forums.phpfreaks.com/topic/12249-help-with-edit-option-on-my-forum/ Share on other sites More sharing options...
redarrow Posted June 17, 2006 Share Posted June 17, 2006 An idear. why not put all the users information in a session and give the userthe abilty to change message before posting. Quote Link to comment https://forums.phpfreaks.com/topic/12249-help-with-edit-option-on-my-forum/#findComment-46724 Share on other sites More sharing options...
bobleny Posted June 17, 2006 Author Share Posted June 17, 2006 I don't belive its possible to edit a post before it's posted......... . .. . Quote Link to comment https://forums.phpfreaks.com/topic/12249-help-with-edit-option-on-my-forum/#findComment-46726 Share on other sites More sharing options...
redarrow Posted June 17, 2006 Share Posted June 17, 2006 [!--quoteo(post=385038:date=Jun 17 2006, 06:32 PM:name=Bob Leny)--][div class=\'quotetop\']QUOTE(Bob Leny @ Jun 17 2006, 06:32 PM) [snapback]385038[/snapback][/div][div class=\'quotemain\'][!--quotec--]I don't belive its possible to edit a post before it's posted......... . .. .[/quote]we do it on here dont we but with preview post. Quote Link to comment https://forums.phpfreaks.com/topic/12249-help-with-edit-option-on-my-forum/#findComment-46728 Share on other sites More sharing options...
bobleny Posted June 17, 2006 Author Share Posted June 17, 2006 Oh! That’s what you mean. Well, that’s for later. I just think having the message written out twice for each post is slow and unnecessary. So I wonder if there is a better way to do it? Quote Link to comment https://forums.phpfreaks.com/topic/12249-help-with-edit-option-on-my-forum/#findComment-46733 Share on other sites More sharing options...
redarrow Posted June 17, 2006 Share Posted June 17, 2006 [!--quoteo(post=385045:date=Jun 17 2006, 06:43 PM:name=Bob Leny)--][div class=\'quotetop\']QUOTE(Bob Leny @ Jun 17 2006, 06:43 PM) [snapback]385045[/snapback][/div][div class=\'quotemain\'][!--quotec--]Oh! That’s what you mean. Well, that’s for later. I just think having the message written out twice for each post is slow and unnecessary. So I wonder if there is a better way to do it?[/quote]The user can see the update information and the written info at the same time is that wright.edit.users can see the main messages as well as the edit message so you see both that what you mean. Quote Link to comment https://forums.phpfreaks.com/topic/12249-help-with-edit-option-on-my-forum/#findComment-46736 Share on other sites More sharing options...
bobleny Posted June 17, 2006 Author Share Posted June 17, 2006 I don't under stand what you mean? Quote Link to comment https://forums.phpfreaks.com/topic/12249-help-with-edit-option-on-my-forum/#findComment-46737 Share on other sites More sharing options...
redarrow Posted June 17, 2006 Share Posted June 17, 2006 Your inserting 2 copies for 1 message and puting one in a table so the user has the abilty to edit it. Quote Link to comment https://forums.phpfreaks.com/topic/12249-help-with-edit-option-on-my-forum/#findComment-46741 Share on other sites More sharing options...
bobleny Posted June 17, 2006 Author Share Posted June 17, 2006 Yes, I'm inserting the post into a database and then writing it out to the php page. It's being written out to be displayed as a post and it is being written out to a hidden input field so that when the user clicks edit, I can receive the message on the other page and insert it into a text area to be edited.What I want to do, is get rid of both hidden input fields. I have an input field for the post id and an input field for the post message. How can I create and edit page so that I don’t need hidden fields?This is the form being used.[code]<form action='forum_edit_1.php' method='post'><input type="hidden" name="message" value="<?php echo $message ?>"><input type="hidden" name="id" value="<?php echo $id ?>"><input type='Submit' value='Edit'></form>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/12249-help-with-edit-option-on-my-forum/#findComment-46744 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.