|
Posted by bill on 06/16/07 21:10
Cigar2011 wrote:
> I will try to be short and to the point.(good Luck) I have a form
> written in HTML. I have a Mysql database. I am using a linux server
> and I would like to use php to write the following code:
>
> After the user inputs their name, address, email, phone, etc. in my
> html form. They will hit the submit button. I need for the information
> they entered to go into my database.
>
> I have looked now for about 12 hours and haven't been able to find an
> answer. I know I must be missing something since I've been to the w3
> site, codewalkers, phpfreaks,php.net(?), and many more.
>
> If there is an easier way of doing this I would love to hear it.
>
> If somene could point me in the right direction I could stop banging
> my head and pulling my hair.
>
> THANK YOU in advance for your advice.
>
> Neil
>
The data from the form with go to the script named in the action
parameter of the form tag.
in that script the data will be in the $_POST array.
eg:
<form action="contact_manage.php" method="post">
<input type="text" name="fname" size="20" />
<input type="text" name="lname" size="20"/>
<input type="submit">
then in the script, "contact_manage.php"
$first_name = $_POST['fname'];
$last_name = $_POST['lname'];
But, don't even think about putting user supplied data directly
into the database. Bad things can happen.
http://us2.php.net/manual/en/security.database.sql-injection.php
bill
Navigation:
[Reply to this message]
|