Jump to content

Previewing data before submitting to db


neo926

Recommended Posts

So, I have a sports writing site. I have a form set up for my writers so they can submit their columns (Title, Column content, etc.). The data input is processed and submitted to my MySQL database.

The problem with this is that the writers can't see what the final product is going to look like on the mainpage, to make sure they have everything formatted properly. I want to add a button next to the 'submit' button that will open up a new page that will process the data and display it on a preview page, so they know how it's going to look on the mainpage.

I don't know how to do this. I already have the form set up like this: [code]<form method="post" action="<?php echo $PHP_SELF ?>">[/code]

So I don't know how I can redirect the form information into this new page to preview the data using a preview button instead of submitting the data to the database. Any help would be appreciated.
Link to comment
Share on other sites

You could store the data in a session or just create a preview page with a form to submit the data after it's been previewed. Using javascript isn't really the best way because a user may disable js or the browser they are using may not support js.
Link to comment
Share on other sites

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.