Page 1 of 1
Php Form Processing
Posted: Mon Apr 03, 2006 3:32 pm
by Pwnious
I have searched the internet for this. I want to create a form processor with processes the form to a page which only certain people can access. I got everything down but the form processing. Does anyone have this code or can you lead me to the right direction?
Thanks.
Posted: Mon Apr 03, 2006 3:34 pm
by josh
What's your form look like? What is your existing code? What is it exactly you are trying to do when you say "process"?
Re: Php Form Processing
Posted: Mon Apr 03, 2006 4:27 pm
by Christopher
Pwnious wrote:I have searched the internet for this.
I just Googled "PHP form processing" and there are many results. Form processing is a fairly large subject. Maybe post you code.
Re: Php Form Processing
Posted: Mon Apr 03, 2006 5:53 pm
by Pwnious
arborint wrote:Pwnious wrote:I have searched the internet for this.
I just Googled "PHP form processing" and there are many results. Form processing is a fairly large subject. Maybe post you code.
Yeah I know, but it is not the kind of form processing I want. I need to make one which processes the form to post on a webpage.
Re: Php Form Processing
Posted: Mon Apr 03, 2006 7:02 pm
by Christopher
Pwnious wrote:Yeah I know, but it is not the kind of form processing I want. I need to make one which processes the form to post on a webpage.
I am assuming from that you mean that you want to create a HTML form and have it post its values to a PHP script to validate the form. Is that the kind of form processing you want? Again, post some HTML or PHP code and we can help.
Posted: Mon Apr 03, 2006 7:24 pm
by Pwnious
Yes somthing like that, I can work on it after I get some info on that.
click here for form and the only php code I got so far for this is
Code: Select all
<?php echo $_POST['insert name']; ?>
Posted: Mon Apr 03, 2006 7:31 pm
by khendar
You'll need to store the information from the form somewhere so the webpage can retrieve or display it. You need to decide whether you want to use a flat file or a database to do this. Both are pretty much the same amount of coding, but the database will require some setup.
If you know this already, then you need to explain what kind of processing you are talking about ? Do you mean validation/verification ? Error checking ? Calculations ?
More information will help.
Posted: Mon Apr 03, 2006 8:07 pm
by Pwnious
Flat file? Any info on that? I am currently useing the database to store the inputs, Not done yet. the form processing suppose to display the input on a webpage ,but i guess validation/verification.
Posted: Mon Apr 03, 2006 8:42 pm
by Ambush Commander
Flat file = plain old text, csv or dbm file that resides on the filesystem, usually called the "poor man's database." If you've got a database then stick with it.
Hmm... it's a big subject. Let's try the socratic method. Once the data is sent to you, what do you think you'd do with it first?
Posted: Mon Apr 03, 2006 8:43 pm
by khendar
Flat file just means storing the data in a text file. If you are using a database then you dont need this.
You can display the form data in a webpage once, but if you want it to stay there you have to store it in your database. To display the data submitted from the form:
Code: Select all
$field_1 = $_POST['field_1'];
$field_2 = $_POST['field_2'];
...
etc
echo "$field_1<br>$field_2<br>...etc";
Where field_1 etc are the names of the <input> fields in the form. This will only display the data as a once off. As soon as the user navigates away from this page it will disappear.
What sort of validation are you talking about ? What sort of data is the form going to submit ?
Posted: Mon Apr 03, 2006 9:12 pm
by Pwnious
Ok I'll stick with the database.