| | |
Sending Form Fields to Database
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
php Syntax (Toggle Plain Text)
<?php if isset() //validate data entered howver you require { { define ('MYSQL_SERVER', 'MYSQLHOST'); define ('MYSQL_PASSWORD', 'MYSQLPASS' ); define ('MYSQL_USERNAME', 'MYSQLUSER'); define ('MYSQL_DB', 'MYSQLDB'); if (!(@mysql_pconnect(MYSQL_SERVER, MYSQL_USERNAME, MYSQL_PASSWORD) and @mysql_select_db(MYSQL_DB))) die(sprintf("Cannot connect to database, error: %s", mysql_error())); } if (!mysql_query(sprintf("insert into MYSQLDB_table (data1, data2, data3, data4, data5, ) values ('%s', '%s', '%s', '%s', '%s', '%s');", $data1, $data2, $data3, $data4, $data5,))) { echo "error adding your geoip entry to database!<br>"; echo mysql_errno().": ".mysql_error()."<BR>"; return false; } return true; } ?> <form action='<?php echo $_server['PHP_SELF']; ?>'> <!-- input form -->
Last edited by almostbob; Jan 14th, 2009 at 5:18 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
•
•
Join Date: Oct 2008
Posts: 89
Reputation:
Solved Threads: 4
if u can post ur forum's html i can post back the whole php code for it
•
•
Join Date: Oct 2008
Posts: 76
Reputation:
Solved Threads: 6
This, by the way is called php, if your interested in this, you might want to check these two links:
http://w3schools.com/php/default.asp
http://hudzilla.org/phpwiki/index.php?title=Main_Page
The first one is universal, a goiod site for web tutorials of any kind.
The second is a great tutorial (which I am in the middle of myself)
you should look at both really.
http://w3schools.com/php/default.asp
http://hudzilla.org/phpwiki/index.php?title=Main_Page
The first one is universal, a goiod site for web tutorials of any kind.
The second is a great tutorial (which I am in the middle of myself)
you should look at both really.
If I have been helpful add to my reputation!
![]() |
Similar Threads
- storing the selected value of a drop-down list (PHP)
- Submit two values from a form at once using $_GET and javascript (JavaScript / DHTML / AJAX)
- How the process of sending message of confirmation will be done ? (Java)
- Syntax Error - Missing Operator (ASP)
- AJAX generated <select> and FIREFOX (JavaScript / DHTML / AJAX)
- Can a text link pass php variables? (PHP)
Other Threads in the HTML and CSS Forum
- Previous Thread: static css footer at the bottom of windows
- Next Thread: css question
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






