Jump to content

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?
Link to comment
https://forums.phpfreaks.com/topic/12249-help-with-edit-option-on-my-forum/
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.
[!--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.
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]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.