Page 1 of 1

HELP

Posted: Wed Aug 23, 2006 11:12 am
by xux
hi everybody,
I need help in implementing preview in php ,just like the preview being used in this forum.i hope to implement it in a newsletter app am working on.Thanks

Posted: Wed Aug 23, 2006 12:11 pm
by feyd
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
Are you looking for conceptual advice or the actual code to do it? If you want code, you'll have to post your code first.

Conceptually, it's a fake posting. You do everything that would be done to the post as if it was submitted for real except you don't store any results anywhere except back in the page for further editing.

Posted: Wed Aug 23, 2006 12:18 pm
by paladaxar
I think Feyd (as most of the time) has the best solution, but another possibility would be to have a second table. If your primary table is called "entry" the second one could be called "preview_entry". So if you HAD to store the preview, you could put it in preview_entry and then periodically run a cron job to clear out anything in preview_entry that is more than, say, 2 hours old.

I'm not really sure why you would want to do it this way, but I'm just throwing out an idea since you werent very specific with what your needs are.

Posted: Wed Aug 23, 2006 4:48 pm
by RobertGonzalez
All a preview is, is the data that will eventually be put into the database without the databasing. Show what was posted. That is a preview.

Posted: Wed Aug 23, 2006 5:19 pm
by Chris Corbyn
I've just come to shout at you for making such a silly thread title :P

j/k