Insert rows into any MySQL database table using a form.
h2. Warning
If you are using this module in external mode, that is, to insert data into a database other than the EE installation's own, _do not make the form public_, as it displays the target database user's password in the HTML.
h2. Compatibility
The module is compatible with ExpressionEngine v1.x.
h2. Parameters
h3. Required parameters
h4. Table
The database table in which to insert the data.
h3. Optional parameters
h4. Database
The
database parameter is required only if inserting into a table on an external database. In this scenario the
hostname,
password and
username parameters are also required.
h4. Hostname
The
hostname parameter is required only if inserting into a table on an external database. In this scenario the
database,
password and
username parameters are also required.
h4. Password
The
password parameter is required only if inserting into a table on an external database. In this scenario the
hostname,
database and
username parameters are also required.
h4. Return
The URL to which the form will return. if empty, the form returns to the same page.
h4. Username
The
username parameter is required only if inserting into a table on an external database. In this scenario the
hostnmae,
database and
password parameters are also required.
h2. Examples
{exp:external_saef:form
hostname="www.someauctionhouse.com"
database="someauctionhouse_auctions"
username="auctioneer"
password="good1es"
table="bids"
return="/log-bids/{segment_2}/{segment_3}/bid-logged"
}
<p><b>Auction #{segment_2}</b></p>
<p><input type="hidden" name="bids_auction" value="{segment_2}" /></p>
<p><b>Lot #{segment_3}</b></p>
<p><input type="hidden" name="bids_lot" value="{segment_3}" /></p>
<p><b>Bidder</b></p>
<p><input type="text" name="bids_bidder" value="" /></p>
<p><b>Amount</b></p>
<p><input type="text" name="bids_amount" value="" /></p>
<p><input type="submit" value="Log Bid" /></p>
{if segment_4=="entry-added"}
<p id="entry-added" >Bid logged</p>
{/if}
{/exp:external_saef:form}
Changelog
h4. v1.0.1 (2010 Apr 11)
* Added SQL Injection Prevention for all parameters as security measure
Roadmap
* add profiles via the module's control panel screen so that external db's need not have their username and password exposed
* enable update as well as insert
* make compatible with EE v2.x