Log in

View Full Version : PHP forms



Macca
03-12-2009, 02:23 PM
I am new to PHP. In fact I only started yesterday after helpful advice on another thread.

I have captured values from an HTML form to my PHP file. However there is two parts to the form. (i.e The first part is completed by the user but part two is completed by someone else.

Is it possible to build a container and pass the values from the PHP file to another PHP file?

Snookerman
03-12-2009, 02:52 PM
I'm not sure I understand what you want but if I do understand, you can use $_POST (http://se.php.net/manual/en/reserved.variables.post.php) or $_GET (http://se.php.net/manual/en/reserved.variables.get.php) to pass info from the form to another page. If you want something else, please try to explain it again.

Good luck!

Macca
03-12-2009, 03:49 PM
Ok here goes.

I have a form that I have dveloped (HTML).

The first part is completed by the submitter. The final part of the form is completed by someone else.

1st part.
The HTML values (Part 1) is sent to a PHP file. I have got this working fine.

2nd Part
From this PHP file the values from the HTML form is shown. Also the final part of the form can be completed. It then sends to another PHP file with all values collected. However here is when I am getting stuck. The second PHP file only collects values from Part2 and not the first part.

Is there are way to capture all values?

?foru
03-13-2009, 12:41 AM
Do you have access to a database like mySQL? You probably don't have that many fields in your form so it wouldn't take much to set it up. You could have pages submit to(your user form) and pages that pull from/update the records(admin pages)...which may make it easier if you wanted to add additional pages and they would all use the same thing with the values stored in the database.

Ex.
User form has fields A B C
Admin form has fields D E F

Both are filled out by those individuals and all values are stored in the database.

If you do have access to a database and think that this is something you want to give a shot post back and we can help from there. Sounds like you already have a PHP page that processes the form so you can add a few lines to write the values to the database as well.