How to create an update page

i want to create an update page using dreamweaver and record set, i succeded but it only updates the database with user id of 1. even if i login as another user with id of 3, it keeps updating the user with id of 1.please help me, a lost. below is my code:
<?php require_once('Connections/conn_login.php'); ?>
<?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;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE login SET username=%s, pwd=%s, `role`=%s, firstname=%s, lastname=%s, country=%s WHERE userID=%s",
                       GetSQLValueString($_POST['email'], "text"),
                       GetSQLValueString($_POST['pwd'], "text"),
                       GetSQLValueString($_POST['role'], "text"),
                       GetSQLValueString($_POST['firstname'], "int"),
                       GetSQLValueString($_POST['lastname'], "int"),
                       GetSQLValueString($_POST['country'], "int"),
                       GetSQLValueString($_POST['id1'], "int"));
  mysql_select_db($database_conn_login, $conn_login);
  $Result1 = mysql_query($updateSQL, $conn_login) or die(mysql_error());
  $updateGoTo = "index.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $_SERVER['QUERY_STRING'];
  header(sprintf("Location: %s", $updateGoTo));
$colname_Recordset1 = "-1";
if (isset($_GET['userID'])) {
  $colname_Recordset1 = $_GET['userID'];
  $_SESSION['userID'] = $_GET['userID'];
$colname_Recordset1 = "-1";
if (isset($_GET[''])) {
  $colname_Recordset1 = $_GET[''];
mysql_select_db($database_conn_login, $conn_login);
$query_Recordset1 = sprintf("SELECT userID, username, pwd, `role`, firstname, lastname FROM login WHERE userID = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $conn_login) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Scuba2u</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php include('headerScuba2u.php'); ?>
<div id="main">
    <div id="left">
      <h1>Registration Form</h1>
      <fieldset>
        <legend>Register for our website</legend>
        <form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">
          <p>
            <label for="firstname">First Name</label>
            <input name="firstname" type="text" id="firstname" size="30" maxlength="40" />
          </p>
          <p>Last Name
            <label for="lastname"></label>
            <input name="lastname" type="text" id="lastname" size="30" maxlength="40" />
          </p>
          <p>Country
            <input name="country" type="text" id="country" size="30" maxlength="30" />
          </p>
          <p>Email
            <label for="email"></label>
            <input name="email" type="text" id="email" size="60" maxlength="60" />
          </p>
          <p>Password
            <label for="pwd"></label>
            <input name="pwd" type="password" id="pwd" size="10" maxlength="10" />
          </p>
          <p>
            <input name="role" type="hidden" id="role" value="guest" />
            <input name="id1" type="hidden" id="id1" value="<?php echo $row_Recordset1['userID']; ?>" />
            <input type="submit" name="submit" id="submit" value="Register" />
          </p>
          <input type="hidden" name="MM_update" value="form1" />
        </form>
      </fieldset>
    </div>
</div>
<?php include('footerScuba2u.php'); ?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

Temporarily change your id1 field from a hidden field to a text field so you can see if it is being set correctly for the logged in user.

Similar Messages

  • Default value in LOV field in Create and Update page in OAF

    Hi All,
    I am unable to default LOV field in Create and Update page in OAF.
    I tried in below way :
    OAMessageLovInputBean lovBean1 = (OAMessageLovInputBean)webBean.findChildRecursive("AAA");
    But I am getting developer mode exception, so please guide me how i can set the default value for create and update page instead of using code in process request method in controller.
    Thanks

    Hi,
    1) In case of create, you can default the value either in EOImpl or in AM while initializing the row:
    //in EOImpl
    public void create(AttributeList attributeList)
    super.create(attributeList);
    setXXAttribute(<value>);
    //in AM, VO new row initialization :-
    VOImpl VO = getVO1();
    VO.setMaxFetchSize(0);
    VORowImpl row = (VORowImpl)VO.createRow();
    row.setXXAttribute(<value>);
    VO.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    2) In case of update, execute the VO (also set the where clause if required) in PR method of update page.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to create a Registration page in WebDynpro java

    Hi All,
    How to create a registration page in Web Dynpro java.Whatever i enter in the field of registration page should be stored in the pcd..So plz help me???
    Message was edited by: suman sahu

    Hi Suman,
        I have a similar kind of requirement , please let me know if you have got the solution for this??
    Regards,
    Ravi.

  • Does anyone here knows how to create a login page thru JDBC?

    Anyone here knows how to create a login page which connect to database thru JDBC but not JDBC-ODBC bridge?

    Hi..pls you'll do people here a great good if you could explain yourself better..!
    Anyway if you are trying to connect to an Oracle Database you dont need the jdbc-odbc bridge as oracle provides a special driver for java applets/applications that is "the thin driver" and the "oci driver"..so if you are connecting to Oracle your connection will look like this:
    Class.forName("oracle.jdbc.driver.OracleDriver"); //not sun.jdbc.odbc.JdbcOdbcDriver
    Connection con = DriverManager.getConnection ("blah blah, blah");
    no need for the jdbc-odbc bridge.
    I hope i've answered your question.
    Thanks.

  • How to create an update listener using event notification in MDM Java2 API.

    Hi folks,
    I need some help on how to create an update listener for Customer updates in MDM using notification API. Could some one point me to where I should start. We are still using SP5.
    Thanks
    -Sai

    Hi All,
    I need to create update listener with notifications and it is giving this error.
    Nov 14, 2008 12:26:21 PM com.sap.mdm.internal.net.ConnectionImpl finalize
    INFO: Disconnect was not called. Cleaning up connection in finalize.
    Nov 14, 2008 12:26:21 PM com.sap.mdm.internal.net.ConnectionImpl finalize
    INFO: Disconnect was not called. Cleaning up connection in finalize.
    Nov 14, 2008 12:26:21 PM com.sap.mdm.internal.net.ConnectionImpl finalize
    INFO: Disconnect was not called. Cleaning up connection in finalize.
    I am still using SP05 and noticed that some mentioned that MDM4J.jar has to be used. Can someone throw some pointers how to do this with MDM4J.jar. Can I  include MDM4J.jar in the same project along with mdm-admin.jar, mdm-core.jar, mdm-common.jar, mdm-protocol.jar or I shoudl have only MDM4j.jar to create this listener. Any help is appreciated.
    Thanks
    -sai

  • How to create conditional update trigger in sql server

    How to create conditional update trigger in sql server

    You cant create a conditional update trigger. Once you create an update trigger it will get called for every update action. However you could write logic inside it to make it do your activity based on your condition using IF condition statement
    Say for example if you've table with 6 columns and you want some logic to be implemented on update trigger only if col3 and col5 are participating in update operation you can write trigger like this
    CREATE TRIGGER Trg_TableName_Upd
    ON TableName
    FOR UPDATE
    AS
    BEGIN
    IF UPDATE(Col3) OR UPDATE (Col5)
    BEGIN
    ....your actual logic here
    END
    END
    UPDATE() function will check if column was involved in update operation and returns a boolean result
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to create a master page in Dreamweaver?

    Hi
    Does anyone know how to create a master page in Dreamweaver ??

    Dreamweaver Templates ~
    http://www.smartwebby.com/web_site_design/dreamweaver_template.asp#1
    Server-Side Includes ~
    http://www.smartwebby.com/web_site_design/server_side_includes.asp
    Spry Tabbed Panels ~
    http://labs.adobe.com/technologies/spry/samples/tabbedpanels/tabbed_panel_sample.htm
    Spry Accordion Panels ~
    http://labs.adobe.com/technologies/spry/samples/accordion/AccordionSample.html
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • How to create a "Child" page?

    Hi there,
    I have been watching tutorials on Apple's site and cannot find any help on how to create a Child Page in iWeb. In other words, how to create pages "under" other pages?
    Any advices?
    Thanks,
    PapaChill

    iWeb doesn't provide the capability to do this natively, but see the +"Drop Down Menus in iWeb"+ section HERE. And you'll find more suggestions by doing THIS.

  • How to create a html page

    Hello,i am very new to dreamweaver 8,and i have searched
    everwhere possible on how to create a html page.My website has a
    navegation bar.And on the navegation bar it has links,like
    forums,your accounts,and etc,but thats already integrated with the
    website.Now i have an option in the admin area,wher i can create a
    new category so that it would show up in the navegation bar,and i
    have a drop down menu where i cans select what to put in that
    category.But also i have an option to put a external url,so that
    when they click on it,it will take them to where that link is
    directed.The point is that i asnt to make a category in the
    navigation menu that says Lirics.So that i can put lirics of songs
    and etc,and that when users click on that link it will take them to
    the lirics page..Do you guys understand?Sorry for the bad english,i
    am now quite good with it..

    The most eloquent description will do nothing for us. To get
    a solution to
    your problem, we must see your code. Can you upload the file
    and post a
    link to it, please?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "don_playboy" <[email protected]> wrote in
    message
    news:eaadi9$kjf$[email protected]..
    > well what i am trying to say is that i created a Folder
    named
    > Liricas(which is
    > lirics in spanish),on my ftp.Now since i created that
    folder in my ftp,it
    > will
    > show on my navegation menu control panel.But it will be
    blank since it has
    > nothing on it.Now what i want to do is,sicne i created
    that folder,and i
    > go to
    > my nav meny control panel and select it as a category it
    will show on my
    > navegation menu(the Liricas that is),but when u click it
    it has
    > nothing,since
    > it has no html or anything in the category.Now i want to
    create a html
    > page so
    > that i can put albums names,and under those albums name
    i want to create a
    > link
    > or category thats for lirics.So all this will be stored
    on the ftp.and
    > when
    > users click on the Liricas category on my navigation
    menu,it will take
    > them to
    > the liricas index page,which will show all the lirics...
    >
    >
    >
    >

  • How to create a HTML page like iView, thanks in advance!

    How to create a HTML page like iView, thanks in advance!
    I'm a newcomer, would you please tell me how to create a HTML page in WebDynpro ? In fact, i want create one welcome page which use html format and include some javascript.
    thanks again.

    jakinapallykrishna , thank you very much for you reply.
    The pdf file is a simple application, but i want know how create a view in HTML format (<HTML>... </HTML>), maybe use HTMLB control, i don't sure it.
    In fact, I need create a view in portal, some pictures in it, once mouse over one picture, it need change another picture replace old one. I don't know how to do it, just know it can be handled in HTML page. So, i need help.
    Thanks.

  • How to create a One Page checkout

    Hello nice people,
    Does anybody knows how to create a ONE-PAGE Check Out Process in Online Shop Layout?
    Thanks in advance

    "I can resolve the problem if I can insert one page (or step) after
    "registration - buy". This would be a "summary" page where the customer has
    the last opportunity tu check out all his data and, if it is needed, to
    correct his order, billing address, shipping, the way of payment"
    <<< The only way to do this is with JS. You can use jQuery's .load() method
    to load your cart into the registration layout. You'll have to do some
    parsing of that cart table to obtain things like product name, quantity etc
    and present this in some kind of summary. Parsing tables in jQuery is not a
    nice task, so if you're going to embark onto producing this kind of summary
    you may want to get rid off the table from the cart and simple throw in
    some divs and tags which will help you parse the cart nicely. That mans
    you'll have to construct the layout for the cart though using JS.
    Example of alternative cart layout:
    It renders like this:
    product one
    (S)
    product one
    (M)
    onchange="UpdateItemQuantity(this.value,231502,234492,6737768,183427,'','US');return
    false;" class="cartInputText" type="text" value="1">
    onchange="UpdateItemQuantity(this.value,231502,234492,6737768,183428,'','US');return
    false;" class="cartInputText" type="text" value="3">
    $10.00
    $45.00
    $55.00
    You can see that this is much nicer to read and you can then construct your
    own data structure that will hold this info and render it it whichever way
    you want to. You can even write it back as a table where each product is in
    its own row. You may want to look at something that gives you template.
    model, controller like ember.js.
    Anyway, I hope that helps somewhat.
    Cheers,
    M

  • How to create a multi-page collapsible & CSS styleable table of contents box?

    How to create a multi-page collapsible & CSS styleabe table of contents box?
    Is there a tool available for Dreamweaver or for standalone operation that can create for multi-page articles a collapsible & CSS styleabe table of contents box based on the page titles?

    You could do this with jQuery.
    Table of Contents -
    http://www.downloadjavascripts.com/list/javasiteccc68/Details.aspx
    Collapsible Panels, Tables & Accordions -
    http://www.downloadjavascripts.com/Collapsible_And_Free_Accordion_Panels.aspx
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • How to create an admin page

    Hi,
    Im trying to create an admin page for my application,although im not sure if this can be done.Does anyone know if this could be possible or if there is a How-To Document available for this?
    Basically I want to have a page available that people can go into and make changes to the application that ive made...these changes might include changing the name of a Tab on a page, or even changing the name of a textfield on a page, etc.
    The user should be able to make these changes from the live web page and not have to go into the 'edit application' screen.Table columns would have to be updated also.
    Any ideas would be greatly appreciated,
    Thanks,
    Brian.

    What you would need to do is have a field in your database
    called somethinfg
    like "order_in_list" and do your sorts on this field. To do
    the move up/down
    you would set a function that altered this number and then
    refreshed the
    page.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "pepps" <[email protected]> wrote in message
    news:f02p9s$g30$[email protected]..
    > Hi
    >
    > I have just created a dynamic news scroller populated by
    a database, i am
    > going to create an admin page so users can add new news
    feeds,
    >
    > How in the admin page can i change the order of the
    feeds lets say i
    > wanted to
    > make the data on row 5 belong to row 4 instead, like a
    move up or down
    > feature.
    >
    > Is this possible
    >
    > Thanks
    >
    > John
    >

  • How to create a 4 page pdf from images - each page should open at same size

    How do I create a 4 page pdf (from 4 images - all the same size) that opens each page at  full page size?
    Thank you so much.
    Ginger
    PREVIOUS MSG:
    My goal is to create multi page pdfs that are created from images (scans of old brochures).  I receive images (scans of pages) all at the same size.
    I have been able to create the 4 pdfs (each opens at full page size) and merge into 1 pdf.  When I open that final pdf, I  see a column of 4 pages, page 1 image being larger than the remaining 3. When I  click on the left, page 1, icon,  I get the full page.  When I click on icons for pages 2 - 4, I get nothing.  The only way I can get the other pages in a full page view is to adjust the scaling after left icon is selected.  That is not what I want.
    How I created the files.
    I can either create pdf pages using Photoshop, or using Acrobat Pro itself through:
    File> Create PDF> From File and adding each of the images.  I then, for each, choose Properties> Initial View> Fit Page> Save. Then I use File> Combine> Merge Files into Single PDF> Save.
    Then I open the multi page pdf.
    I appreciate any help.
    Thank you,
    Ginger
    PREVIOUS MS

    It seems to me what you want to do is create one document which a combination of all four  and then one page of each.
    To create a Document with 4 pages combined in to one PDF.  open the first in a Series the to Edit menu and click on add pages click on next document (browse to document first) the choose attach to to end of document or add to  end of document. Repeat until you get all images added. They will end up (or should ) center in center of their own page. Save this document with a new name for now.
    Next go back to Photo shop and reduce size of images to fit desired sheet of paper (8-1/2 by 11, 8-1/2 by 14, whatever) place them side by side and row by row so you have 4 images on one page.
    now save as Pdf.
    now decide which you want to swap to the Thumbnails (the 4 on one page, or 4 individual pages.  I would use the thumbnails and make each a button that references the page in the document you save as a 4 page pdf that applies.
    Then on that page write a line saying click each illustration to see full size image (you might have to write this line while in Photoshop) then save this as PDF file
    Try out. You might have to use some javascript controls to do this. But I am not experienced in JavaScript to do this. I'm sure it cane be done.
    But note you will have to save both documents with the Thumbnails and the four page and Thumbnail page in a folder and send to prospect
    If you want just four separate pages in one Pdf just do first two paragraphs above

  • How to create a asp page in dreamweaver cc 2014

    How in the hec do I create an asp page in Dreamweaver CC.
    I installed the database, server behaviors.  I can create a PHP page and add database connections for that type but not Asp?
    Help anyone?
    Thanks Traci

    Create a new HTML document.
    Go to File > SaveAs > filename.asp
    Nancy O.

Maybe you are looking for

  • Does anybody now how to Uninstall Viuscan 32 bit on a Windows 8.1 64 bit version?

    My Canoscan 9000F MK II requires Viuscan 64 bit on Windows 8.1 64 bit.  But, somehow I've got the 32 bit version on my system too.  It must have come in a bundle I got somewhere and theres no uniinstall for it.  Email support at Viuscan (the only sup

  • Error Message in CS6 Indesign

    When i place a pdf in Indesign CS6, I get an error message: "Cannot cropt to Trim box. Either the trim box is not defined, or is empty" Any ideas on what this is referring to or what causes this issue...

  • Having itunes open when ipod is connected

    Nano 4th generation--iTunes always opened when iPod was connected to computer; now it doesn't and going to Devices and scrolling down Summary to "open when ipod is connected" is greyed out and will not allow me to check it.  Even going to the iTunes

  • Use of TA_WS_SOAP_HEADER in SALT

    Hi all, I give up, I simply do not understand how to use "Defining the SOAP Header" function in SALT I have asked before, and Maurice answer but I have been forced to deal with other stuff until now. The thing is that we have a Plugin and we also hav

  • Camera Raw and DNG Converter 4.4.1 Now Available

    Details here: http://blogs.adobe.com/lightroomjournal/2008/04/lightroom_141_and_camera_raw_4.html Regards, Tom