Jump to content

Archived

This topic is now archived and is closed to further replies.

bobleny

Help with edit option on my forum.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
An idear.

why not put all the users information in a session and give the user
the abilty to change message before posting.

Share this post


Link to post
Share on other sites
I don't belive its possible to edit a post before it's posted......... . .. .

Share this post


Link to post
Share on other sites
[!--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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
[!--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.

Share this post


Link to post
Share on other sites
Your inserting 2 copies for 1 message and puting one in a table so the user has the abilty to edit it.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.