HELP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xux
Forum Newbie
Posts: 1
Joined: Wed Aug 23, 2006 10:44 am

HELP

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
paladaxar
Forum Commoner
Posts: 85
Joined: Fri Jun 18, 2004 11:50 pm

Post 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.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I've just come to shout at you for making such a silly thread title :P

j/k
Post Reply