Jump to content

Form submission with POST method and java script - pls help


chathu

Recommended Posts

I have a form submission using POST method with 3 forms one by one separately.

When the first form (page1.php) successfully filled by the user it should by directed to the next page (page2.php) using NEXT button. After the completion of the 2nd page it should be directed to the 3rd page (page3.php) using NEXT button.

If any fields in any form missed by the user  before go to next page it should be alert to the user using java script message.

At the last page( 3rd page) it could be submitted to the system. and also be able to EDIT, DELETE using  EDIT, DELETE  buttons.

 

:( I have already turn on the "register_global" but unfortunately  the variables in the 1st page are not passing to the 3rd page.

Could someone help me to recover this

And give me the necessary steps to do it with example

Link to comment
Share on other sites

First of all you should definitely NOT turn on register_globals. That is a security risk that you can do well without and it also helps promote bad coding practices. You need to store the passed variables when being submitted, for example in a session. You should also not rely solely on client-side validation if that is what you do now.

Link to comment
Share on other sites

Put it all in sessions. ( remember to destroy the session at the end )

 

As you work through the pages, insert the posted data into the session.

 

on page3 then just grab all the data you want from the session.

 

IE: your username is : $_SESSION['username'];

 

<?php
session_start();


$_SESSION['username'] = $_POST['username'];

?>

 

 

As the guy above said, also dont reply on client side checks..

So make some form of function that you can run vars through to clean out any nasty chars etc

Link to comment
Share on other sites

Thanks for the help for both of you. But it wasn't solved my problem.

I turned off the register globals and tried with SESSIONS as u told.

But the same problem exists.

SESSION variables were passed to the 2nd page but not for 3rd.

My submission of the forms done at the 3rd page. So all the variables page 1+page 2+page 3 should be submited at the 3rd page and all the data Should be available to add,edit,delete

I appreciate your help very much

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.