Insert/Update Record - Server Behavior

Help Please!
I have several pages with forms that insert records, but I
over the weekend when I went to open them from the web to
insert/update records errors appeared. They were working fine
before. Using PHP, MYSQL and Dreamweaver CS3
I have tried everything I know to do. I have recreated the
page, same problem as well as delete behaviors and reapply them.
Once the server behavior is added it no longer says Insert
Record in the Application window instead it says "Dynamic
Attribute" Further, when I click it to make any changes etc,
instead of the screen for Insert or Update record coming up it is a
"Dynamic Text box" regarding POST or GET or URL stuff.
Edited to add: And once posted, the page only shows an error
and references this line
<html xmlns="
http://www.w3.org/1999/xhtml">
Error Message
Parse error: syntax error, unexpected '<' on line 40
What can I do?

You don't say which server-side language you're using, but the way that I would troubleshoot this in PHP is to use echo to display the value of $_SESSION['MM_Username'] at the bottom of the admin page. This is the session variable Dreamweaver uses to control access to a page with username and password. If the value is displayed, it means sessions are working, and the variable hasn't been destroyed.
If that works, move onto the next page, and use echo to display the value of $_SESSION['MM_Username'] as soon as the session has been started. To prevent being redirected to the fail page, temporarily comment out the following line:
header("Location: ". $MM_restrictGoTo);
Basically, you need to check what's happening to the session variable that controls access to the pages.

Similar Messages

  • Update Record Server Behavior

    Using Dreamweaver MX 2004. I have a recordset created, and
    need to update a table. When I select the Update Record server
    behavior I get the following message "before using this behavior,
    please create a recordset". However the recordset has already been
    created, and it tests fine, I can see the data in the tables, and I
    am able to insert a record, delete a record, but not update...
    Using ASP JavaScript Server model with Access databse. Any help is
    much appreciated.
    Thanks! :

    Hi
    Have you already made the binding? - it's not obvious from
    your posting - but you should have a form with the initial data you
    want to update bound to it before you can update.
    I won't bang on about this because maybe you did it already.
    bfn

  • Update record server behavior preventing passage of form parameter in php

    I have a multi-page survey set up in php. I am trying to pass a form variable to the next page, but the 'update record' server behavior is preventing me from passing the variable to the next page. I have tried including the variable as a parameter in the url, but this is not working either. Please help.

    Can you not pass it onto the next page using a SESSION?
    As an example say you want to pass the information from a form field with the name 'company' to another page.
    At the top of the page that the form is submitted to you start a SESSION - <?php session_start(); ?> - then you collect the information from the form as normal BUT using a SESSION variable - $_SESSION['company']
    The resulting php code might look like below:
    <?php
    session_start();
    $_SESSION['company'] = $POST['company'];
    ?>
    Then you can pass the SESSION variable on to as many page as you like:
    So for instance the next page in the chain needs <?php session_start(); ?> at the top again to initiate a SESSION.
    Then the resulting code may look like below. The information from the form field 'company' is being passed from page to page.
    <?php session_start(); ?>
    <?php
    if(isset($_SESSION['company'])) {
    echo $_SESSION['company'];
    else {
    echo "Company name is not set";
    ?>

  • Update Record Server Behavior blows error (its part of CS5.5 standard installation!)

    One wouldn't expect the code supplied by a MAJOR CORPORATION and WEB DEVELOPMENT TECHNOLOGY LEADER to blow an error on one of the server behaviors it supplies as part of its standard install. But then again, there is reality.  The UpdateRecord.js, to be found in your installation on Windows 7 at ..ProgramFiles(x86(/Adobe Dreamweaver CS5.5/configuration/ServerBehaviors/Php_MySQL/UpdateRecord.js  causes an error when it is selected from the SERVER BEHAVIORS menu.  This happens BEFORE you I enter anything into the fields.  The error states:  "While executing onLoad in  UpdateRecord.htm, the following JavaScript error(s) occured: At line 687 of file "........UpdateRecord.js":  name has no properties.  I've looked at the code and it is beyond my comprehension.  Something about the NAME of a value in the node list.... I just don't have the chops to go rewriting Adobe's code.  If I did, I'd be making the big bucks.  Does anybody know what to do about this? About my system:  Windows 7, 64bit,   CS5.5 (on a lease so it is up to date) using PHP and MySQL, on a remote dedicated server running Apache on Linux.   :<)McFrisco

    Ok, I deserved that spanking.  I was just frustrated.  Sorry for the rant. 
    I've managed to figure out a workaround on this.  There really is something wacky going on with Dreamweaver and the Update Record handler.  Here's what I did:   
    How to trick DREAMWEAVER into writing an UPDATE RECORD. 
    Dreamweaver's server behavior for Update Record doesn't work correctly sometimes.  The symptom of this is that when you try to fill in the popup form provided by the Server Behaviors/Update Record menu item, it doesn't allow you to choose form fields to update to the database if they are posted there by a previous page.  It only allows you to choose them if they are bound to the database.  This doesn't do any good, because you are updating a record with the information from the database you want to update, NOT with new information.  Kind of weird... But here's the way to get around it.  Its a bit tedious but it works.   
    1.  On a clean php page, set up a form with the input fields matching the database fields you want to update.  This page is to be used as the RESULT page of a form submitted on a previous page where the UPdate Record won't work due to conflicts, plugins, or some other unknown reason.   
    2.  Connect to the database table you want to update,  and set up a new RECORDSET on the page. 
    3.  Bind all the form fields to the appropriate database fields. 
    4.  Do an Update Record behavior based on this form.  This will actually do nothing but update the record with the stuff that is already in the record, as noted above.   
    5. Delete the php code that sets up the record set.  But, LEAVE THE Update Record code alone!  It is correct.   
    6.  Change the bindings of all the fields in the FORM to the $_POST[] variables passed from the form on the previous page. (Make sure the previous page form uses the POST, not the GET method.)
    Now, when you submit the form it will pick up the values in the form, which have been passed from the previous page's form.

  • Clueless NEWBIE DEVELOPER, NEEDS ASSIST with Insert Record Server Behavior

    Experienced DW designer learning CFMX7. I cannot seem to get
    beyond this error message when using the Insert Record server
    behavior to write data from a form into the database. Using MS
    Access 2002, CFMX7's internal server, DW 6.0. Please note that I am
    learning development for the first time and am using tutorials. I
    was able to connect at one point but now I cannot.
    See error message below:
    The following information is meant for the website developer
    for debugging purposes.
    Error Occurred While Processing Request
    Error Executing Database Query.
    Syntax error in INSERT INTO statement.
    Resources:
    Enable Robust Exception Information to provide greater detail
    about the source of errors. In the Administrator, click Debugging
    & Logging > Debugging Settings, and select the Robust
    Exception Information option.
    Check the ColdFusion documentation to verify that you are
    using the correct syntax.
    Search the Knowledge Base to find a solution to your problem.
    Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
    SV1; .NET CLR 1.1.4322)
    Remote Address 127.0.0.1
    Referrer
    http://localhost:8500/moosek/TMPu724j3nl2j.cfm
    Date/Time 07-Aug-06 07:23 PM
    Text
    Text

    MongoSlade,
    I had this exact same problem with a CFMX 7 datasource that
    was set up as Microsoft Access with Unicode. It turns out that
    "Password" is a reserved word in the Unicode driver. Or somewhere.
    I got around it by putting square brackets, i.e., [ ] around the
    column name, like this:
    update MyTable
    set [Password] = '#form.Password#'
    where UserID = '#form.UserID#'
    That solved the problem nicely. I hope this solution will
    work for you as well.

  • CS6 Dreamweaver using PHP & MySQL - Delete Record Server Behavior?

    When I try to insert the Delete Record server behavior. I get an error message about a DeleteRecord.js file, which seems to be missing or defective.  I cannot use the server behavior.  I have a file that I developed using CS5, and it does indeed delete the record, but does not proceed to the destination I want.  I cannot change that except in the server behavior, so I'm stuck.  I have noticed that server behaviors seem to disappear without apparent cause, as it seems to have in this case.  I will appreciate any suggestions!  Is there any way to embed a call to a target page manually?  All is working WITHOUT the server behavior appearing, but I want to go to a confirmation display page that shows the record is indeed deleted, and we just return to the (now blank) delete confirmation page.  That'll drive a user bonkers!
    Thanks!
    Delete Record in CS6 Dreamweaver using PHP & MySQL?

    Well, your error message is self-explanatory.
    DW stores ServerBehaviors in 'Configuration' folder in installation directory. If one of the behavior JS files is missing/ corrupt, you'll see the error message you just did.
    I've uploaded a functional, proper version of DeleteRecord.js onto my site for you to download. Here's the link:
    http://www.sudarshan.me/adobeforum/dw/app/behavior-js/DeleteRecord.zip
    Download this file, extract it and put DeleteRecord.js file in your installation directory as follows. If prompted, 'replace' your local copy:
    Mac: Applications > Adobe Dreamweaver CS6 > Configuration > ServerBehaviors > PHP_MySQL
    Windows: C:\Users\Your User Name\AppData\Roaming\Adobe\Dreamweaver CS6\[language]\Configuration\ServerBehaviors\PHP_MySQL
    It should work as expected.
    If that still doesn't solve the problem, reset your DW preferences and cache and try doing it. Follow the instructions here to reset cache: http://forums.adobe.com/thread/494811
    Let us know how it goes.
    -ST

  • Can following query be used to find inserted update records.

    hi,
    i am using query1) to insert data query2) to update the record
    query1)
    INSERT INTO [t1]
               ( id
                ,createddatetime
               ,updateddatetime)
         VALUES
               (1
               ,GETDATE()
               ,GETDATE()) 
    query2)
    update t1 set updatedatetime=getdate() where id=@t1
    please tel me will two date cols get same time , that is, will i be able to 
    write following to find inserted/updated rows
    if exists(select * from t1 where createddt1=updateddt2)
    begin 
    select 'inserted'
    end 
    else
    begin 
    select 'updated'
    end
    yours sincerely

    Depending on how you execute both the queries there's a small chance date value comparison may not wok as expected as datetime also has timepart until milliseconds precision. So if you want to retrieve details on records inserted and updated you may use
    something like below
    query 1
    DECLARE @dt datetime
    SET @dt = GETDATE()
    INSERT INTO [t1]
    ( id
    ,createddatetime
    ,updateddatetime)
    VALUES
    (1
    ,@dt
    ,@dt)
    query2
    DECLARE @dt datetime
    SET @dt = GETDATE()
    update t1 set updatedatetime=@dt where id=@t1
    then you can do below to get inserted updated detailsif exists(select * from t1 where createddt1=updateddt2)begin select 'inserted'end elsebegin select 'updated'end
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Delete Record server behavior problem

    Hi all!
    I'm such a painful situation, that I can't figure out, why my
    Delete
    Record form don't work as supposed.
    It seems all things work (also gives message "You have
    successfully
    deleted the article."), but the problem is
    that in the MySQL (5) database real deletion doesn't
    occure...
    I was walking along with very nice tutorial
    (www.adobe.com/devnet/dreamweaver/articles/php_blog2_11.html)
    if someone has time to think about...
    I have all the steps (from the tutorial) done multiple times
    and
    result... no real deletion, despite "successfully deleted"
    text :(
    with regards,
    andreta

    Yeah! As always - if one is doing too much over and over,
    then it's too
    much of trouble.
    I used sample delete_art.php(premade by Marius) file instead
    of mine and
    it worked!
    If I was wondering what is different, then there was large
    amount of
    additional code in my file:
    In pre-made sample is 200 lines versus 242 in mine :(
    Differences(looked with Winmerge):
    MINE(not working): Working:
    (why my DW8 inserts session handling in this way?)
    1)
    $_SESSION['MM_Username'] = NULL;
    session_unregister('MM_Username');
    $_SESSION['MM_UserGroup'] = NULL;
    session_unregister('MM_UserGroup');
    $_SESSION['PrevUrl'] = NULL;
    unset($_SESSION['MM_Username']);
    unset($_SESSION['MM_UserGroup']);
    unset($_SESSION['PrevUrl']);
    2)
    if (!isset($_SESSION)) { session_start();
    session_start();
    3)
    in NONworking: (in WORKING - nothing )
    (NB! this was a double-code - i think because of the redoings
    (?recordset deleting & recreating?) )
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType,
    $theDefinedValue = "",
    $theNotDefinedValue = "")
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue)
    : $theValue;
    $theValue = function_exists("mysql_real_escape_string") ?
    mysql_real_escape_string($theValue) :
    mysql_escape_string($theValue);
    switch ($theType) {
    case "text":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case "double":
    $theValue = ($theValue != "") ? "'" . doubleval($theValue) .
    : "NULL";
    break;
    case "date":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    break;
    case "defined":
    $theValue = ($theValue != "") ? $theDefinedValue :
    $theNotDefinedValue;
    break;
    return $theValue;
    4)
    NONworking:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml"><!--
    InstanceBegin
    template="/Templates/admintemplate.dwt.php"
    codeOutsideHTMLIsLocked="false" -->
    Working:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"
    http://www.w3.org/TR/html4/loose.dtd">
    <html>
    5)
    NonW:
    <?php do { ?>
    <tr class="topheader">
    <td><?php echo $row_rsDeletedArticle['title_art'];
    ?></td>
    Working:
    <tr class="topheader">
    <td><?php echo $row_rsDeletedArticle['title_art'];
    ?></td>
    6)
    NONW:
    <td colspan="3"><?php echo
    $row_rsDeletedArticle['text_art']; ?></td>
    </tr>
    <tr>
    <td colspan="3"> </td>
    </tr>
    <?php } while ($row_rsDeletedArticle =
    mysql_fetch_assoc($rsDeletedArticle)); ?>
    </table>
    <table width="30%" border="0" cellspacing="0"
    cellpadding="0">
    <tr>
    <td><form id="delete" name="delete" method="post"
    action="delete_art.php">
    <input name="yes" type="submit" id="yes" value="yes"
    />
    <input name="id_art" type="hidden" id="id_art"
    value="<?php echo $row_rsDeletedArticle['id_art']; ?>"
    />
    </form>
    </td>
    <td><form id="cancel" name="cancel" method="post"
    action="list_art.php">
    <input name="no" type="submit" id="no" value="No" />
    </form>
    </td>
    </tr>
    </table>
    <?php } // Show if recordset not empty ?>
    <?php if ($totalRows_rsDeletedArticle == 0) { // Show if
    recordset empty ?>
    <p>You have successfully deleted the
    article.</p>
    <form id="back" name="back" method="post"
    action="list_art.php">
    <input name="back" type="submit" id="back" value="Back"
    />
    </form>
    <?php } // Show if recordset empty
    ?><p>  </p>
    <!-- InstanceEndEditable --></td>
    Working:
    <td colspan="2"><p><?php echo
    $row_rsDeletedArticle['text_art']; ?></p></td>
    </tr>
    <tr>
    <td colspan="2"><table width="15%" border="0"
    cellspacing="0" cellpadding="0">
    <tr>
    <td><form action="delete_art.php" method="post"
    name="delete" id="delete">
    <input name="yes" type="submit" id="yes" value="Yes">
    <input name="id_art" type="hidden" id="id_art"
    value="<?php echo $row_rsDeletedArticle['id_art'];
    ?>">
    </form></td>
    <td><form action="list_art.php" method="post"
    name="cancel" id="cancel">
    <input name="no" type="submit" id="no" value="No">
    </form></td>
    </tr>
    </table></td>
    </tr>
    </table>
    <?php } // Show if recordset not empty ?>
    <?php if ($totalRows_rsDeletedArticle == 0) { // Show if
    recordset
    empty ?>
    <p>You have successfully deleted the
    article.</p>
    <form action="list_art.php" method="post" name="back"
    id="back">
    <input name="back" type="submit" id="back"
    value="Back">
    </form>
    <?php } // Show if recordset empty ?>
    <p>  </p>
    <p> </p> <p> 
    </p></td>
    </tr>
    Boo-oo-hh!
    It's enough for now
    Please can someone give me advices about what is wrong with
    the nonworking
    (I deleted the section 3 from nonworking but it anyway
    doesn't work)
    AndreTa wrote:
    > Oh, sorry!
    >
    > additional information - working with DW8.0.2, PHP
    5.1.6, and with the
    > "blog" database with MySQL 4.1.14
    > (have also MySQL 5.0 - havn't tried with this... I'll do
    it after sweet
    > dreams and hard workday i.e. tomorrow)
    > In local PC WinXP, Apache 2.2.3
    >
    > andreta
    >
    >

  • Tabular Form - submit custom data and insert/update records

    I have a tabular form with 2 columns representing table data and 5 more custom columns.
    Task ID
    Task Name
    10/7/2013 to 10/13/2013
    10/14/2013 to 10/20/2013
    10/21/2013 to 10/27/2013
    10/28/2013 to 11/3/2013
    11/4/2013 to 11/10/2013
    1
    TASK1
    2
    TASK2
    3
    TASK3
    I use an sql which returns null values for columns 3 to 7. Then I use the html formatting option of apex and jquery to add change the headers to weeks and add checkboxes.
    My sql: select task_id, task_name, null week1, null week2, null week3, null week4, null week5 from <table name>
    My table has the columns task id, task name , start_date and end_date.
    When the user clicks the submit button, i need to send the checkbox data to my stored procedure and insert records into the corresponding table. I am unable to find out how to send a mapping of the task_id, date headers in each column and the checkbox data to apex back end and process them. For example, if the first check box in first row is checked, i should insert a row with values "1, TASK1, 10/7/2013, 10/13/2013". I also have to read the data from the table and display it in the same format. Please let me know how to accomplish this in apex.

    instead of using null, you can use apex_item api to create check boxes
    read http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_item.htm#CHDDCHAF
    you can set the value of check boxes using apex_item api and then the value can be captured in your process
    check this: Martin Giffy D'Souza on Oracle APEX: APEX Report with checkboxes (advanced).
    let me know if this answers your query in the current thread
    Regards,
    Vishal
    Oracle APEX 4.2 Reporting | Packt Publishing
    Vishal's blog

  • Problem with update record, then link to file

    Environment:
    Dreamweaver 8, MySQL, PHP.
    I have a repeating record from my database. I added an Update
    Record server behavior for each search result for the result table.
    I added a button to the form and changed "submit" to "view".
    Pressing "view" is supposed to allow the user to view the detailed
    record information.
    The Update Record server behavior is supposed to do two
    things:
    1) add 1 to the 'numViews' filed of the record's database
    entry when the "view" button is pressed
    2) After updating the numViews field, the form is supposed to
    redirect the user to the detailed record
    I found that depending on how I create the record, I an do
    one of the above 2 behaviors, but not both. HELP!
    To add 1 to the numViews field, I created a form variable
    called incNumViews, which does the following:
    <?php echo $row_rsSearchResults['recipeNumViews']+1; ?>
    Very simple.
    The Update Record ends up changing the form action to the
    following:
    <?php echo $editFormAction; ?>
    Looking at the code for this, I ee the following:
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
    $editFormAction .= "?" .
    htmlentities($_SERVER['QUERY_STRING']);
    But when the "view" (ie: submit" button for the form is
    pressed, I get redirected back to the same repeating record search
    result page, not to the record detail page.
    However, the numViews field in the record is getting properly
    incremented.
    I tried to get around this by changing the Update Record
    behavior "After updating, go to:" field to point to the record
    detail page, and tried passing a parameter tot he recordID I want
    to see details of, as a URL parameter, but that does not work.
    If I change the Update Record form action from
    <?php echo $editFormAction; ?>
    to
    record_detail.php?recordID=<?php echo
    $row_rsSearchResults['recordID']; ?>
    Then I am able to link to the detail page, but NOT update the
    numViews field.
    HOW can I fix this to both update the record, then jump to
    the detail page with a URL parameter being passed, when I click the
    "view" (submit) button o the form??
    Thanks in advance.

    If the user's computer doesn't know what to do with a TIFF file, I guess that Open button would be missing.  Tiff is not a web normal file format, or even a common one for graphics applications....

  • CS5 Update Record behaior deletes the record

    Hello
    I am having an issue that I just cant seem to understand or resolve.
    I am using the CS5 Update Record Server Bahavior to update the user table for a website, but instead if updating the record, it deletes the entire record.
    I look at the SQL and it is definately an Update, so I dont see how it deleting the entire record.
    What I did:
    Passed in record ID through querystring to get the filtered recordset
    Created update form for dynamic data (the corrent data is filling form from recoredset)
    Created hidden field to hold ID
    Clicked the Update Record Server Behavior and matched form variables to appropriate DB fields
    Set it to go to page to list all users
    Saved page
    Run on local server (php/MySQL)
    When I edit the user  data in the update form and click submit, the record is deleted.
    * I checked the MySQL DB and the entire recored has been deleted
    Anyone have a clue on why this is happening?
    Here's the code from the page:
    <?php require_once('../Connections/localconn.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "updateuser")) {
      $updateSQL = sprintf("UPDATE users SET fname=%s, lname=%s, uname=%s, password=%s, ulevel=%s WHERE id=%s",
                           GetSQLValueString($_POST['fname'], "text"),
                           GetSQLValueString($_POST['lname'], "text"),
                           GetSQLValueString($_POST['uname'], "text"),
                           GetSQLValueString($_POST['pword'], "text"),
                           GetSQLValueString($_POST['ulevel'], "int"),
                           GetSQLValueString($_POST['id'], "int"));
      mysql_select_db($database_localconn, $localconn);
      $Result1 = mysql_query($updateSQL, $localconn) or die(mysql_error());
      $updateGoTo = "users.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
        $updateGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $updateGoTo));
    $colname_Recordset_users = "-1";
    if (isset($_GET['id'])) {
      $colname_Recordset_users = $_GET['id'];
    mysql_select_db($database_localconn, $localconn);
    $query_Recordset_users = sprintf("SELECT * FROM users WHERE id = %s", GetSQLValueString($colname_Recordset_users, "int"));
    $Recordset_users = mysql_query($query_Recordset_users, $localconn) or die(mysql_error());
    $row_Recordset_users = mysql_fetch_assoc($Recordset_users);
    $totalRows_Recordset_users = mysql_num_rows($Recordset_users);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Title</title>
    <meta http-equiv="Content-Language" content="English" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW">
    <link rel="stylesheet" type="text/css" href="style.css" media="screen" />
    </head>
    <body>
    <div id="wrap">
    <div id="top"></div>
    <div id="content">
    <div class="header">
    <h1><a href="#">FENA </a></h1>
    <h2>Content Management System (CMS)</h2>
    </div>
    <div class="breadcrumbs">
    <a href="#">Home</a> &middot; Edit User
    </div>
    <div class="middle">
    <h2>Edit User - <?php echo $row_Recordset_users['lname']; ?>, <?php echo $row_Recordset_users['fname']; ?></h2>
    <form method="POST" action="<?php echo $editFormAction; ?>" name="updateuser"> 
    <table>
    <tr>
         <td>Last Name</td>
            <td><input name="lname" type="text" value="<?php echo $row_Recordset_users['lname']; ?>" /></td>
        </tr>
        <tr>
         <td>First Name</td>
            <td><input name="fname" type="text" value="<?php echo $row_Recordset_users['fname']; ?>" /></td>
        </tr>
        <tr>
         <td>Username</td>
            <td><input name="uname" type="text" value="<?php echo $row_Recordset_users['uname']; ?>" /></td>
        </tr>
        <tr>
         <td>Password</td>
            <td><input name="pword" type="text" value="<?php echo $row_Recordset_users['password']; ?>" /></td>
        </tr>
        <tr>
         <td>User Level</td>
            <td>
             <select name="ulevel">
                 <option value="<?php echo $row_Recordset_users['ulevel']; ?>"><?php echo $row_Recordset_users['ulevel']; ?></option>
                    <option value="1">Admin</option>
                    <option value="2">Editor</option>
                </select>
            </td>
        </tr>
        <tr>
         <td colspan="2" align="right"><input name="id" type="hidden" value="<?php echo $row_Recordset_users['id']; ?>" /><input name="submit" type="submit" value="Submit" /></td>
        </tr>
    </table>
    <input type="hidden" name="MM_update" value="updateuser" />
    </form>
    </div>
    <div class="right">
    <h2>Navigation</h2>
    <ul>
    <li><a href="index.php">Home</a></li>
    <li><a href="users.php">Users</a></li>
    <li><a href="users_add.php">Add User</a></li>
    </ul>
    </div>
    <div id="clear"></div>
    </div>
    <div id="bottom"></div>
    </div>
    <div id="footer">
    Developed by Me
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset_users);
    ?>

    Hi Paul,
    I am actually try to a create a submit a process and have it to update the DB.
    Thanks,
    Han

  • Updating Record

    I have created a form that allows a user to enter information into a database where each user has one record. Now I want to create a page that allows the user to update their record. What I have done so far is created a “my profile page” that the user is able to access once they login which contains all the information that they provided on the registration page.  Also on that page I have place an edit link so that they pulls up the “edit my profile page”. From there I created an update record query, but when I tested it to see if worked it doesn’t update the database. I am not even sure where the data is going at this point. Any help would be appreciated.
    Here is the code for my profile page:
    <?php require_once('Connections/rescue.php'); ?>
    <?php
    //initialize the session
    if (!isset($_SESSION)) {
      session_start();
    // ** Logout the current user. **
    $logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
    if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
      $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
      //to fully log out a visitor we need to clear the session varialbles
      $_SESSION['MM_Username'] = NULL;
      $_SESSION['MM_UserGroup'] = NULL;
      $_SESSION['PrevUrl'] = NULL;
      unset($_SESSION['MM_Username']);
      unset($_SESSION['MM_UserGroup']);
      unset($_SESSION['PrevUrl']);
      $logoutGoTo = "logout.php";
      if ($logoutGoTo) {
        header("Location: $logoutGoTo");
        exit;
    ?>
    <?php
    if (!isset($_SESSION)) {
      session_start();
    $MM_authorizedUsers = "";
    $MM_donotCheckaccess = "true";
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
      // For security, start by assuming the visitor is NOT authorized.
      $isValid = False;
      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
      // Therefore, we know that a user is NOT logged in if that Session variable is blank.
      if (!empty($UserName)) {
        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
        // Parse the strings into arrays.
        $arrUsers = Explode(",", $strUsers);
        $arrGroups = Explode(",", $strGroups);
        if (in_array($UserName, $arrUsers)) {
          $isValid = true;
        // Or, you may restrict access to only certain users based on their username.
        if (in_array($UserGroup, $arrGroups)) {
          $isValid = true;
        if (($strUsers == "") && true) {
          $isValid = true;
      return $isValid;
    $MM_restrictGoTo = "login.php";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  
      $MM_qsChar = "?";
      $MM_referrer = $_SERVER['PHP_SELF'];
      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
      if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
      $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
      header("Location: ". $MM_restrictGoTo);
      exit;
    ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $colname_rsmyprofile = "-1";
    if (isset($_SESSION['register_login'])) {
      $colname_rsmyprofile = $_SESSION['register_login'];
    mysql_select_db($database_rescue, $rescue);
    $query_rsmyprofile = sprintf("SELECT * FROM user_registration WHERE register_login = %s", GetSQLValueString($colname_rsmyprofile, "text"));
    $rsmyprofile = mysql_query($query_rsmyprofile, $rescue) or die(mysql_error());
    $row_rsmyprofile = mysql_fetch_assoc($rsmyprofile);
    $totalRows_rsmyprofile = mysql_num_rows($rsmyprofile);$colname_rsmyprofile = "-1";
    if (isset($_SESSION['MM_Username'])) {
      $colname_rsmyprofile = $_SESSION['MM_Username'];
    mysql_select_db($database_rescue, $rescue);
    $query_rsmyprofile = sprintf("SELECT * FROM user_registration WHERE register_login = %s", GetSQLValueString($colname_rsmyprofile, "text"));
    $rsmyprofile = mysql_query($query_rsmyprofile, $rescue) or die(mysql_error());
    $row_rsmyprofile = mysql_fetch_assoc($rsmyprofile);
    $totalRows_rsmyprofile = mysql_num_rows($rsmyprofile);
    ?>
    <table width="591" cellpadding="2" cellspacing="2">
      <tr class="mainlabels">
        <td colspan="4" bgcolor="#FFFFFF" style="color: #FFF; font-family: 'Arial Black', Gadget, sans-serif; font-size: 16px; font-weight: bold;"><div align="left"></div></td>
      </tr>
      <tr class="mainlabels">
        <td colspan="4" bgcolor="#FF0000" style="color: #FFF; font-family: 'Arial Black', Gadget, sans-serif; font-size: 16px; font-weight: bold;"><div align="left">Your Information</div></td>
      </tr>
      <tr>
        <td class="mainlabels" style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color: #000; font-weight: normal;"> </td>
        <td class="mainlabels"> </td>
        <td class="mainlabels"> </td>
        <td class="mainlabels"><a href="editmyprofile.php" style="color: #F00; font-weight: bold;"><u>Edit</u></a></td>
      </tr>
      <tr>
        <td width="93" class="mainlabels" style="font-size: 12px; font-family: Arial, Helvetica, sans-serif; color: #000; font-weight: normal;"><div align="left">Name:</div></td>
        <td width="192" class="mainlabels"><div align="left"><?php echo $row_rsmyprofile['register_name']; ?></div></td>
        <td width="107" class="mainlabels"><div align="left"></div></td>
        <td width="175" class="mainlabels"><div align="left"><img src="images/small_logo.jpg" width="100" height="25" alt="Small Logo" /></div></td>
      </tr>
      <tr>
        <td class="mainlabels"><div align="left"><span class="mainlabels">PrimaryEmail</span>:</div></td>
        <td class="mainlabels"><div align="left"><?php echo $row_rsmyprofile['register_pemail']; ?></div></td>
        <td class="mainlabels"><div align="left">Second Email:</div></td>
        <td class="mainlabels"><div align="left"><?php echo $row_rsmyprofile['register_semail']; ?></div></td>
      </tr>
      <tr>
        <td class="mainlabels"><div align="left">Land Line:</div></td>
        <td class="mainlabels"><div align="left"><?php echo $row_rsmyprofile['register_phone']; ?></div></td>
        <td class="mainlabels"><div align="left">Cell Phone:</div></td>
        <td class="mainlabels"><div align="left"><?php echo $row_rsmyprofile['register_cellphone']; ?></div></td>
      </tr>
      <tr>
        <td class="mainlabels"><div align="left">Username:</div></td>
        <td class="mainlabels"><div align="left"><?php echo $row_rsmyprofile['register_login']; ?></div></td>
        <td class="mainlabels"><div align="left">Password:</div></td>
        <td class="mainlabels"><div align="left"><?php echo $row_rsmyprofile['register_pass']; ?></div></td>
      </tr>
      <tr>
        <td class="mainlabels"><div align="left"></div></td>
        <td class="mainlabels"><div align="left"></div></td>
        <td class="mainlabels"><div align="left"></div></td>
        <td class="mainlabels"><div align="left"></div></td>
      </tr>
      <tr class="mainlabels">
        <td colspan="4" bgcolor="#FF0000" style="font-family: 'Arial Black', Gadget, sans-serif; font-size: 16px; color: #FFF;"><div align="left">Emergency Contact Information</div></td>
      </tr>
      <tr>
        <td colspan="2" class="mainlabels"> </td>
        <td class="mainlabels"> </td>
        <td class="mainlabels"> </td>
      </tr>
      <tr>
        <td colspan="2" class="mainlabels"><div align="left">Emergency Contact 1</div></td>
        <td class="mainlabels"><div align="left"></div></td>
        <td class="mainlabels"><div align="left"></div></td>
      </tr>
      <tr>
        <td class="mainlabels"><div align="left">Name:</div></td>
        <td class="mainlabels"><div align="left"><?php echo $row_rsmyprofile['con1_name']; ?></div></td>
     

    This thread has been moved to the Dreamweaver Application Development forum, which deals with PHP and other server side issues.
    When posting questions, it's helpful to see your code, but it's expecting a lot of others to trawl through several hundred lines of code. You say the problem lies with the update page, so why post the profile page if that's working correctly? However, looking at the code for your profile page, it looks incomplete. Anyway, let's not go there if it's working OK.
    When describing a problem, it helps if you explain what happens when you load the page. Looking at your code, I'm fairly sure that the user's details are never loaded into the update form. As a result, the update record server behavior has no way of knowing which record you want to update.
    The problem is that you're using $_SESSION['MM_Username'] to retrieve the user's details in the rseditmyprofile recordset, but there's no active session on the page.
    You need to add session_start() at the beginning of the update page. I suggest you add it here:
    <?php require_once('Connections/rescue.php'); ?>
    <?php
    session_start();
    if (!function_exists("GetSQLValueString")) {

  • Can you do Update Record from an HTML link?

    Can you implement the Update Record server behavior by
    clicking on an HTML link?
    As far as the documentation I've read indicates, the Update
    Record server behavior is only capable of updating a record when a
    Form is submitted.
    I would rather have the action of clicking on an HTML link
    update the record, rather than having a Submit button to update the
    record.
    Is this possible? How do I go about doing this?
    Is

    If you coded the HTML on the page to submit your variables,
    you should be
    able to pull them in to the update page, though you might
    have to manually
    edit some code.
    However, this also means you will always have a link present
    that bots will
    hit (and thus will update your database). Is this what you're
    looking for?
    It certainly doesn't sound like the best method.
    HTH<
    Jon
    "robotai" <[email protected]> wrote in
    message
    news:enk2k1$1l0$[email protected]..
    > Can you implement the Update Record server behavior by
    clicking on an HTML
    > link?
    >
    > As far as the documentation I've read indicates, the
    Update Record server
    > behavior is only capable of updating a record when a
    Form is submitted.
    >
    > I would rather have the action of clicking on an HTML
    link update the
    > record,
    > rather than having a Submit button to update the record.
    >
    > Is this possible? How do I go about doing this?
    > Is
    >

  • Update record with check new user

    I have a page where the already registered member can create
    a username and password to access the secure part of my site. I
    need to be able to 1) check for uniqueness of username (no
    duplicates) , 2) validate my fields (password, confirm password,
    email address)
    Is there a way to apply the check new username behavior to
    the update record server behavior I have in place?
    thanks,
    Rob

    In the server behaviors panel with the submit button
    selected, from the (+) button choose User Authentication then Check
    New Username. There you can set uniqueness and requirements. From
    there, on the behaviors panel (not server behaviors), again with
    the submit button selected, select the (+) button and choose
    Validate Form. From there you can set requirements and validations.
    That should at least help.

  • Find Server Behavior/JavaScript Errors

    I am getting an error whenever I created Update or Insert
    record server behaviors in my pages. When I go through the process
    of adding the behavior, it inserts the VBScript for my ASP page,
    but then I get an error message when findServerBehaviors runs. In
    DW8, it was referring the InsertRecord.htm, in DW CS3, it referres
    to InsertRecord2.htm whenever I run and Insert Server Behavior. As
    I said, it inserts the code, but it will not show an Insert Record
    in the Server Behaviors panel.
    If I close and open DW, the next time I open the page, the
    behaviors will be listed in the panel, but the moment I make any
    changes to the page, and the findServerBehaviors javascript is
    triggered, I get the error message and lose the listing of the
    insert or update in the behavior panel even those the VBScript code
    is still in the page. This is super annoying.
    Anyone have this problem?

    It's probably some extension you have installed that's
    causing the issue. I found a tech support article that helped -
    can't remember where, but basically you recreate your configuration
    by renaming your existing config folder to something like
    "configuration-old" and then restart DW. It will create a new
    config folder and you will have to re-enable all your extensions.
    This solved the problem for me initially and I enabled a few
    extensions every few days until one day the error started happening
    again. For me the problem was caused by the extension "Justso
    Picture Window". Once I disabled that extension, my problems went
    away. It would be nice if DW had some way of telling you which
    extension is causing an issue.

Maybe you are looking for

  • Open TRs show in LL01 for Mvmt type 261, wrong SL on production order

    Hi all, I have the following issue We have roughly 2000 open transfer requirements related to movement type 261 GI to order. They all show up as critical processes in LL01 (Warehouse Activity Monitor) I have looked at the production orders being crea

  • MacBook Pro won't connect wirelessly after 10.5.8 update

    I have a MacBook Pro laptop, which was acquired in 2006. I have used it with my Linksys WRT54G router successfully for years but since I recently updated to 10.5.8, it was able to connect one time, which lasted for a day or so. Now it no longer can c

  • Cannot synchronize as "medium not found"

    I had a G2 (4GB) nano, worked well. Then we got a G3 nano (also 4 GB) and I connected it straight to my iTunes (didn't check before that it has to be under different user accounts Registered the new nano under another name, but somehow the whole proc

  • Bullets in a text field box

    Every time I paste bullets into a text field, they revert to a strange character like a "Y", although they look fine in the edit field. Ideas?

  • Connectivity from VC to BW icubes

    Hi, Let me know whether we can access BW icubes from VC 6.0 using BI query wizard if yes then please let me know what are the setting need to be done and what are the user privilege to be maintained on portal and BW system. what i am trying to do get