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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.