0

I created a form using Dreamweaver and am trying to figure out how to get the form contents saved to a database. Does anyone know of a way to to do this.

4
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by ccube921
0
<?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 -->
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.