Form Processing
Maybe as text since I can make a script to read from a text and post it, I think.
You are going to have to save the files as PHP because that is what is going to process the form $_POST variable, PHP will not parse a text file.
Houdini wrote:You are going to have to save the files as PHP because that is what is going to process the form $_POST variable, PHP will not parse a text file.
Dang. :bemused: I am stuck now.
You can generate HTML with PHP it is great at it, but to include the variable of the posted info the processing file will have to be PHP, you can generate a table and nicely format the output with table headers alternating row colors and all that with php.
Houdini wrote:You can generate HTML with PHP
Yes, thank you. You have any sites/ tutorials that talk about this?
Houdini wrote:.... but to include the variable of the posted info the processing file will have to be PHP, you can generate a table and nicely format the output with table headers alternating row colors and all that with php.
Cool, but I just want it plain. Once I get use to it, I will add detail.
Wait would I be able to save the html that php generates.
You could learn a great deal from this online book Practical PHP (that is the forms section)
or you could just output to a webpage by something like the below.
<?php
echo "Your Name is".$_POST['Applicant\'s Name']."<br />";
echo "Your age is".$_POST['Age']."<br />";
echo "City: ".$_POST['City']."<br />";
echo"State: ".$_POST['State']."<br /.";
// and so on for all the fields in your form
?>
But now the problem is how will it display again. I am guessing I would have to use a database.
Nvm its in the online book.
Yes is you are going to have a member based site a database is almost a necessity. Therefore the reason for the ppopularity of MySQL. So you need to have a databse with a members table and you would save all the variables from the data entered via the HTML form page into the various table.
Suppose you had a table named members and it has the columns of username, age, city,state,country, email,zipcode, and other data, it chould also have a member_id field which is usually auto incremented (meaning that each time a new orw of member data is added it assigns the next sequential number to that new member and ensures that there is a field that is unique..
Try going through the link to the book , it is easy to read and has practical examples that is easy to follow and actually do.
I did, but it had nothing about databases, except for one or twice. I have never messed with MYsql, so I have no clue how to do that.
eh... nvm I found it when I clicked content. :p
That book cover just about everything including the PHP 5 use of objects. He doesn't leave much out.
Cool, I appreciate you help. Thank you.
The cool part about that book is that you can bookmark it or make it a favorite, and it should help you by example get the solution to a lot of PHP related and MySQL related subjects, I don't try the database normilization because it can be quite complex, but for what you would be using a database for you wouldn't need that. Now all you need toknow is if MySQL is available on you hosting server so to find out create the below simple file save it and upload it to the root directory of your server and run it.
<?php
echo phpinfo();
?>
Save it as phpinfo.php and when you run it it will let you know if MySQL is enabled with PHP on that site. You should see a long table of data all about your PHP install on that server.
Yes it is enabled with php since I have a forums.