Jump to content

Update Recordset via form


Recommended Posts

Hey...i making a very simple content management system.

Im making a form to update a record. Im not too sure how to do this in the Dreamweaver enviroment, however i want to give the user who updates the recordset the option to either enter a filename into a field or use a dropdown menu to select a filename (thats a dynamic list form a recordset).

I have been thinking about 2 radio buttons....one that refers to the dropdown menu and one that refers to the maual insert field......however, how could i edit the script that if RadioA is clicked, send info from dropdown to 'filename' (in the recordset)or if RadioB is clicked, send info from manual input field to 'filename'....


Ive has a search around and found something like ;

[code]IF ($_POST['RadioA']=="on") {
    $fileplace=$_POST['dropdown'];
    //do whatever with this fileplace
} ELSE IF ($_POST['RadioB']=="on") {
    $fileplace=$_POST['manualinputfield'];
    //upload new file
}[/code]

But im not to sure where to ad this to the usual dreamweaver update/insert record behaviour around the area of:

[code]if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO guest (FName, Sname, UserName, Email, Password) VALUES (%s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['fname'], "text"),
                       GetSQLValueString($_POST['surname'], "text"),
                       GetSQLValueString($_POST['uname'], "text"),
                       GetSQLValueString($_POST['mail'], "text"),
                       GetSQLValueString($_POST['pass'], "text"));[/code]

...i hope this makes sense!...thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/12948-update-recordset-via-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.