Jump to content


Photo

Help with edit option on my forum.


  • Please log in to reply
8 replies to this topic

#1 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 17 June 2006 - 05:40 PM

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:

<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>

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?
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 June 2006 - 06:26 PM

An idear.

why not put all the users information in a session and give the user
the abilty to change message before posting.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 17 June 2006 - 06:32 PM

I don't belive its possible to edit a post before it's posted......... . .. .
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 June 2006 - 06:34 PM

[!--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) View Post[/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.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 17 June 2006 - 06:43 PM

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?
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#6 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 June 2006 - 06:47 PM

[!--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) View Post[/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.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#7 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 17 June 2006 - 06:50 PM

I don't under stand what you mean?
-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...

#8 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 17 June 2006 - 06:59 PM

Your inserting 2 copies for 1 message and puting one in a table so the user has the abilty to edit it.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#9 bobleny

bobleny
  • Members
  • PipPipPip
  • Advanced Member
  • 429 posts

Posted 17 June 2006 - 07:10 PM

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.
<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>

-- www.firemelt.net --
First do me a favor and read this: JavaScript is NOT Java - Then read this: www.php.net - When your done with that, read this Topic
After that, floors open. I and anyone else will be MORE than happy to answer YOUR query! [Topic Solved]
Cheer up, the worst has yet to come...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users