Use PHP Variables between pages: Session, URL, or Get

Hello

For our association, I developed a registration page.  Registration pages insert a record into a mysql database, using php.  After the user submits the form (by using $post), I want to be redirected to the confirmation page where a mysql database query is executed to retrieve the record, the Member has been added.

To pass the variable, I have developed the following pages using a session variable.

Registration page: http://www.aosweb.org/member_dues.php

Confirmation page: http://www.aosweb.org/member_view.php

Although I asked recently changes to the code, it worked at the same time.  The forum was helpful to get the information I needed.  At this point, the redirect, and the passage of the session variable does not work.  It seems that the available on the page member_view session variable is of the last inserted record.  Thus, the query that is run on member_view returns no result.

I checked some of the forum posts, such as:

-php url parameters

-How to pass parameters of form to confirm page...

-php help registration page!

My questions outstanding are as follows:

1 have I placed the order to set the $_session ('sv_mem_num') in the right place.

2 should I consider another method such as a URL or by using the Get method parameter.

Thank you.

George

$insertGoTo = ' member_confirm.php? mark = ". $_POST ['Member_Num']. » « ;"

If (isset {}
$insertGoTo. = (strpos ($insertGoTo, '?'))? "&" : "?";
$insertGoTo. = $_SERVER ['QUERY_STRING'];
}

What is happening is that the Dreamweaver code is looking for an existing query string and add it. The problem is that you put a query string in your redirect page, which translates as the ampersand is added at the end. That's how I want to change it:

// set the redirect to the target page without a query string
// then let Dreamweaver check for an existing query string
$insertGoTo = "member_confirm.php;
 if (isset($_SERVER['QUERY_STRING'])) {
 $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
 $insertGoTo .= $_SERVER['QUERY_STRING'];
 }

// if a query string has been added, add the memid at the end
// otherwise, create a query string to add memid
if (strpos($insertGoTo, '?')) {
 $insertGoTo .= '&memid=' . $_POST['Member_Num'];
} else {
 $insertGoTo .= '?memid=' . $_POST['Member_Num'];
}

Tags: Dreamweaver

Similar Questions

  • Help, please! Problem in the use of http to call the url?

    Hello

    I develop application for Blackberry 8830, which is the cdma device. I want to develop the application that uses the http protocol to call url and gets the response. To use http everything I read there about 5-6 ways. But the only one that fits my needs is direct TCP. But my service provider in India i.e. Auntie Indidcom says that there can be no adjustments to the AFN for CDMA phones. What should I do now. I don't really know if that's the only problem.  I have this thread

    Different ways to connect with Http.

    There are six ways mentioned below: -.

    1 blackberry Enterprise Server with Blackberry MDS - I have Blackberry Enterprise server, so this is not possible.

    2. blackberry Internet Service - for this, the Alliance with the RIM so still no thuought on this subject.

    3 order TCP - do not get the APN settings

    4 WiFi network - I'm not network Wi - Fi is also to the equation.

    5. WAP Gateway - not looked into this yet.

    The only way I thought direct TCP, but it requires settings APN, but the message that I received from the people of Auntie, it's that the APN settings is supported for GSM based phones and not for CDMA phones. So is it possible, if yes, then please let me know, its urgency.

    Here is the code that I use for the connection.

    HttpConnection httpConnection = null;
                DataInputStream dis = null;
                DataOutputStream dos = null;
                url = "http://mailonphone.com:8180/automaticlicensing/LicensingServlet?" +
                      "UserName=ilesh&Password=ilesh123&SiteCode=012345678901234567890&" +
                      "ScratchCard=05533978;deviceside=true";
                System.out.println("URL=>" + url);
                try
                {
                    httpConnection = (HttpConnection)Connector.open(url, Connector.READ_WRITE);
                    httpConnection.setRequestMethod(HttpConnection.POST);
                    InputStream istrm = httpConnection.openInputStream();
                    String resMsg = httpConnection.getResponseMessage();
                    System.out.println("REsponse Message=" + resMsg);
                    int length = (int)httpConnection.getLength();
                    String str;
                    if (length != -1)
                    {
                        byte servletData[] = new byte[length];
                        istrm.read(servletData);
                        str = new String(servletData);
                    }
                    else  // Length not available...
                    {
                        ByteArrayOutputStream bStrm = new ByteArrayOutputStream();
                        int ch;
                        while ((ch = istrm.read()) != -1)
                            bStrm.write(ch);
                        str = new String(bStrm.toByteArray());
                        bStrm.close();
                    }
                    System.out.println("Registeration Key=>"+str);
                    int in=str.indexOf("");
                    int en=str.indexOf("");
                    key=str.substring(in+6,en);
                    key=key.trim();
                    System.out.println("KEy="+key);
                }
                catch(Exception ex)
                {
                    System.out.println("Error while calling url");
                    key = "In catch while calling url";
                    //sendMenuItem.setText("Message not send");
                }
            }
    

    If there is a problem in the code then let me know also. I could not test this even on the MDS do not work on simulator emulator. Look into that, but if its related to another question please let me know.

    Thank you & best regards

    Sunil

    The exception it throws in wrestling, will give you an idea about the problem.  I suspect something is wrong with your data, for example, you have specified HttpConnection.POST, but you provide no post data, so I think that you really wanted to say HttpConnection.GET.

    WAP 2.0 does not work on the Simulator.

    I recommend that you get your code work using the Simulator (i.e. ";) deviceside = true') until you are exposed to problems trying to connect on a real device.

  • Passing between pages PHP session variable

    I'm sure this must be fairly simple, but I don't use very often.

    Basically, I'm moving a session of an age to another.

    On the first page, I have this:

    <? PHP

    @session_start ();

    if ("" == "")     {

    $_SESSION ['Lodge_GSG_URL'] = ' ".". " $row_rs_Lodge ["GSG_URL"]. » « ;"

    }

    ? >

    And on this page, I cannot repeat the session correctly using:

    <? PHP echo $_SESSION ['Lodge_GSG_URL'];? >

    On the second page, I have that, but it does not display anything:

    <? PHP

    session_start();

    echo $_SESSION ['Lodge_GSG_URL'];

    ? >

    If someone could help that would be much appreciated.


    Thank you!

    JohnGordon1972 wrote:

    I'm sure this must be fairly simple, but I don't use very often.

    Basically, I'm moving a session of an age to another.

    On the first page, I have this:

    <>

    @session_start ();

    if ("" == "")     {

    $_SESSION ['Lodge_GSG_URL'] = ' ".". " $row_rs_Lodge ["GSG_URL"]. » « ;"

    }

    ?>

    And on this page, I cannot repeat the session correctly using:

    On the second page, I have that, but it does not display anything:

    <>

    session_start();

    echo $_SESSION ['Lodge_GSG_URL'];

    ?>

    If someone could help that would be much appreciated.

    Thank you!

    Try to assign information that you extract from the database to a variable, then move this information to the next page by using the variable $_SESSION:

    @session_start ();

    if ("" == "")     {

    $variable = $row_rs_Lodge [GSG_URL'];

    $_SESSION ["Lodge_GSG_URL"] = $variable;

    }

    ?>

  • Several variables from the session to the login page

    Hey there, I have to point out that I use ASP for several years and am trying to start a transition to PHP. I'm kinda stuck and I don't know that there is a simple solution for this. After a login page, I go to my home page. When you are at the homepage depending on the status you are given i.e. level 1, 2 etc.

    Dreamweaver gives you the code to start a page and I seem to be able to capture the session variable 'MM_Username' on the start page, but in my setup, that's your name. Of course there could be a lot of 'Fred' out there so you need the info from the first name field. How to capture the session password or create a new session for password, so when I'm filtering the session on the page following I can use several variables as what follows must match the user name, password, address, etc?

    In asp is was easy. I started just a session variable capture since the names of the fields username and password. Like this:

    < % session ("NomUtilisateur1") = request ("username") % >

    < % session ("password1") = request ("pass") % >

    My session would be NomUtilisateur1, password1, and I would like to sort out.

    In PHP how would I do a similar thing? Help please!

    Here's the code generated from Dreamweaver.

    <? PHP
    If (! function_exists ("GetSQLValueString")) {}
    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    If (via 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 "set":
    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
    break;
    }
    Return $theValue;
    }
    }
    ? >
    <? PHP
    Validate request to connect to this site.
    If (! isset {})
    session_start();
    }

    $loginFormAction = $_SERVER ['PHP_SELF'];
    If (isset($_GET['accesscheck'])) {}
    $_SESSION ['PrevUrl'] = $_GET ['accesscheck"];
    }

    If (isset($_POST['username'])) {}
    $loginUsername = $_POST ['username'];
    $password = $_POST ["password"];
    $MM_fldUserAuthorization = "";
    $MM_redirectLoginSuccess = "/ support/startpageSQL.php";
    $MM_redirectLoginFailed = ' / test2.php ';
    $MM_redirecttoReferrer = false;
    @mysql_select_db ($database_toyosupport, $toyosupport);

    $LoginRS__query = sprintf ("SELECT name, password AND password entry WHERE name = %s is %s",
    GetSQLValueString ($loginUsername, "text"), GetSQLValueString ($password, "text"));

    $LoginRS = mysql_query ($LoginRS__query, $toyosupport) or die (mysql_error ());
    $loginFoundUser = mysql_num_rows ($LoginRS);
    If {($loginFoundUser)
    $loginStrGroup = "";

    If (via PHP_VERSION > = 5.1) {session_regenerate_id (true) ;} else {session_regenerate_id() ;}
    Declare two session variables and assign them
    $_SESSION ["MM_Username"] = $loginUsername;
    $_SESSION ["MM_UserGroup"] = $loginStrGroup;

    If (isset($_SESSION['PrevUrl']) & & false) {}
    $MM_redirectLoginSuccess = $_SESSION ["PrevUrl"];
    }
    Header ("Location:".) $MM_redirectLoginSuccess);
    }
    else {}
    Header ("Location:".) $MM_redirectLoginFailed);
    }
    }
    ? >

    To make this work it turned out to be very simple. at the login page, I simply used:

    <>

    This is to set session values.

    $_SESSION ['username'] = $_POST ['username'];

    $_SESSION ['pass_word'] = $_POST ["password"];

    ?>

    After all the code from Dreamweaver to start a totally different pair of sessions.

    On the home page, I made the Recordset like this:



    <>
    If (! function_exists ("GetSQLValueString")) {}
    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    If (via 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 "set":
    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;
    break;
    }
    Return $theValue;
    }
    }

    $pass_word_rsUSERNAME = "-1";
    If (isset($_SESSION['pass_word'])) {}
    $pass_word_rsUSERNAME = $_SESSION ["pass_word"];
    }
    $user_name_rsUSERNAME = "-1";
    If (isset($_SESSION['user_name'])) {}
    $user_name_rsUSERNAME = $_SESSION ['user_name'];
    }
    @mysql_select_db ($database_toyosupport, $toyosupport);
    $query_rsUSERNAME = sprintf ("" SELECT * WHERE the password = name = %s AND %s entry ", GetSQLValueString ($pass_word_rsUSERNAME,"text"), GetSQLValueString ($user_name_rsUSERNAME,"text")");
    $rsUSERNAME = mysql_query ($query_rsUSERNAME, $toyosupport) or die (mysql_error ());
    $row_rsUSERNAME = mysql_fetch_assoc ($rsUSERNAME);
    $totalRows_rsUSERNAME = mysql_num_rows ($rsUSERNAME);
    session_start();? >

    Although Dreamweaver code struggled a bit he works and seems to be stable. Note that I added a session_start to the top of the page, even if the source code for Dreamweaver does not. This helped.

    I hope this helps.

  • Use a Variable on several pages

    Hello

    I would use the same variable on three pages.  Now I can't get it to work on two.  The first page is a simple HTML form, in which the variable is registered.  The second page uses the variable very well.  I use AJAX to designate a third page and I don't know how to use the same variable on the third page.  The variable is called 'find '.

    On the second page, I have this:

    $find = strip_tags($find);
    $find = trim ($find);
    $result=mysql_query("SHOW TABLES FROM sand2 LIKE '%$find%'")
    or die(mysql_error());

    The second page then AJAX that points to a third/URL of the page, and on this third/URL of the page, I have this:


    function getAllVotes($id)
       {
       $votes = array();
       $q = "SELECT * FROM santafe WHERE id = $id";

    On the third page, I would like to replace the 'Santa Fe' table with the variable "locate," the same variable that I use on the second page.  How can I do this?

    Thanks in advance,

    John

    $q = "SELECT * FROM $_SESSION['find'] WHERE id = $id";

    You cannot use an associative array element in a double quoted string. There are three ways to rewrite.

    1. the braces Suround array element:

    $q = "SELECT * FROM {$_SESSION['find']} WHERE id = $id";

    2. remove the single quotes of the index of the array element:

    $q = "SELECT * FROM $_SESSION[find] WHERE id = $id";

    3 concatenate the variable with the channels on each side:

    $q = "SELECT * FROM " . $_SESSION['find'] . " WHERE id = $id";

    All are valid ways to do it, but I prefer the first way with braces.

  • How to manage Navigation between pages using Cascades

    Hello

    I want to make navigation between the current page and new Page, I tried to use the navigationPane, but I still don't get, again, I'm new to C++, if I create a new FirstPage Class, which contains .cpp and h. files there if ranging from waterfalls, and iin the click button, I should be going to the page? Any sample code will be useful,

    Concerning

    Rakesh shankar, P

    Hello

    I have posted the solution in your other thread.

    http://supportforums.BlackBerry.com/T5/Cascades-development/doubts-regarding-the-creating-stack-of-s...

    In the future please try to stick to one thread to make it easier for others to find solutions to the problems.

    See you soon

    Swann

  • You can use a php variable to filter a Recordset?

    I have a table of "events", which have a description and, more importantly, for this a number of months. (1-12 for the months of the year, when the event takes place).

    I used the function date of php on a page for digitally, what month it is now $thismonth = date("n");

    I want to filter my recordset by bringing only events which take place during the current month so where event_month = $thismonth

    IS this possible? It seems it should be easy to do but I can't make it work.

    Thanks in advance

    Dave

    jnkjnkjnkjnkjn wrote:
    > I want to filter my recordset by bringing only events taking place
    > during the month so where event_month = $thismonth
    >
    > IS it possible? It seems it should be easy to do but I can't seem to
    > work.

    Yes, it is very easy, but you need to do a little coding by hand. In the
    Advanced Recordset dialog box set the end of the SQL query to the place WHERE
    event_month = 1. When you save the Recordset, change the SQL for
    WHERE event_month = $thismonth.

    --
    Adobe Community Expert David Powers
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • using a variable in a url

    Hello
    Thanks for checking! I am trying to set up a folder in a url as a variable

    Here is what my code looks like before I try to use a variable in the url. And it works very well.

    var nextImage:String = "events/1.jpg";
    this.loaderTarget_mc.loadMovie ("loader.swf")


    But when I try to set the events folder as a variable I no chance.

    Gallery of the var: String = "events."
    var nextImage:String = "(gallery) / 1.jpg";
    this.loaderTarget_mc.loadMovie ("loader.swf")


    I hope that what I'm doing wrong here will be obvious to someone who knows more what to do. Any ideas?

    Thanks again
    Scott

    Using the variable inside a string delimiter, it will be as string. Then put the variable outside of the dual code.

    var Gallery = nextImage:String + "/ 1.jpg";

  • Seen Truble reading and echoing using PHP in HTML. Variable scope problem possible?

    Hey guys,.

    Thanks for your help always well informed! Today, I work with the text to a text file in a table HTML with PHP. I can't get the data to display correctly, I think it has something to do with the scope of variables, but I'm not sure. Here's the code I'm struggeling with that:

    <table width="357" border="1" cellspacing="0" cellpadding="0">
      <tr>
        <td width="165">Pizza 1</td>
        <td width="186"><? echo  $price['0']; ?></td>
      </tr>
      <tr>
        <td>Burger 1</td>
        <td><? echo $price['1']; ?></td>
      </tr>
      <tr>
        <td>Drink 1</td>
        <td><? echo $price['2']; ?></td>
      </tr>
    </table>
    

    In the above PHP (not shown), the $price array is properly filled (I tested in echoing every bit line-by-line), but at the moment where we enter the HTML code, it seems that the table is empty or is not love how I am the appellant. Made in the scope of a PHP variable with the closing end '? ">" tag? Am I missing something? Below is the full code:

    <!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>Untitled Document</title>
    <style type="text/css">
    body {
        background-color: #333;
        color: #FFF;
    }
    </style>
    </head>
    
    <body>
    <?php
    $menu=fopen("prices.txt","r") or exit("Unable to open file!");
    $price=array();
    $priceposition=null;
    $tempstring;
    
    //This loop does all of the READING and populating of variables
    while(!feof($menu))
      {
        //Check to see if this is the first pass, if not add one to the array possition
        if ($priceposition==null){
            $priceposition=0;
            }
        else{ 
        $priceposition++;
        }
        
        //populate the temparary string
        $tempstring = fgets($menu);
        
        //Populate the array if the temporary string is not a comment
        if(substr($tempstring,0,2) != "//"){
            $price['$priceposition']= $tempstring;
            echo $price['$priceposition'];
        }
      }
      //End of reading loop
      
      
    fclose($menu);
    ?>
    <table width="357" border="1" cellspacing="0" cellpadding="0">
      <tr>
        <td width="165">Pizza 1</td>
        <td width="186"><? echo  $price['0']; ?></td>
      </tr>
      <tr>
        <td>Burger 1</td>
        <td><? echo $price['1']; ?></td>
      </tr>
      <tr>
        <td>Drink 1</td>
        <td><? echo $price['2']; ?></td>
      </tr>
    </table>
    </body>
    </html>
    

    and you can run the code on my server to test here: christianstest.info/phptest/readwritetesting/readtest.php

    Thank you guys!

    Try to change this-

    fclose ($menu);

    on this subject.

    fclose ($menu);

    ECHO '.

    « ; exit(print_r($price)) ;

    et voir ce que vous obtenez.

  • Prevent the user from changing the page in URL - Apex 5

    Dear community of Apex,

    We seek to protect our handling of URL pages.  The protection of session state is enabled, and each page has page value «Arguments must have Checksum» access protection  However, the documentation seems to discuss in order to prevent the user from element values in the URL.  We want to prevent the user to change the page ID in the URL.  Currently, a user is able to hack the URL and take in the middle of a wizard process for example.  Is it possible to stop this?  Other that an element of creative previous train stop check.

    * Version: Application Express 5.0.1.00.06

    Thank you

    Barry

    bSamuel wrote:

    We seek to protect our handling of URL pages.  The protection of session state is enabled, and each page has page value «Arguments must have Checksum» access protection  However, the documentation seems to discuss in order to prevent the user from element values in the URL.  We want to prevent the user to change the page ID in the URL.  Currently, a user is able to hack the URL and take in the middle of a wizard process for example.  Is it possible to stop this?  Other that an element of creative previous train stop check.

    Hi Barry

    Affecting the security attribute Access Page Protection page No. URL Access and navigate between pages using the type of the Page Management Branch (uncheck the option creates a branch using redirection page in the Wizard) will avoid this:

    No URL access -Page can not be found using a URL, but the page can be the target of a type of Page Management Branch, is not doing a URL redirect.

    It is a little more restrictive that a normal direction of the session state values cannot be positioned or erased declaratively in the branch, but is not often necessary in a several step wizard, and it's pretty simple to work round using prior processes - or post-branche or by referencing the item values directly from other pages.

  • pass variables between form

    Hello

    I use oracle forms 6i.
    How can I pass variables between Forms?
    Consider the scénarion of a login form.
    Once a user logged in successfully, a new form is displayed, where his name is to be displayed
    like '< user > welcome. '
    If name must be past form at the home page login form.

    Is this possible with Oracle?

    Adkins

    Adkins,

    For Global Variables just assign a value to that, and it's initialization. Or you can use

    DEFAULT_VALUE(NULL, 'GLOBAL.');
    

    Make sure that you assign the appropriate value to the global variable before opening the new form.

    And for the parameter, try.

    DECLARE
         Pl_Id PARAMLIST;
    BEGIN
         Pl_Id := GET_PARAMETER_LIST('tempdata');
         IF NOT ID_NULL(Pl_Id) THEN
              DESTROY_PARAMETER_LIST(Pl_Id);
         END IF;
          Pl_Id := CREATE_PARAMETER_LIST('tempdata');
          ADD_PARAMETER(Pl_Id, '', TEXT_PARAMETER, '');
          Open_form('', ACTIVATE, SESSION, Pl_Id);
    END;
    

    Kind regards

    Manu.

    If my answer or the answer to another person has been useful or appropriate, please mark accordingly

    Published by: Manu. April 14, 2010 09:16

  • PHP variable and xml processing

    Hello
    I have a problem that is driving me crazy! I have a php file that creates an xml from a sql query string. The problem is that I need to use a variable from a swf file to create the query. All this should happen when I click a button on the swf page. The xml file is created no problem, but the variable is not used. I am able to use these POST variables in other php files. As you can see it the php file is called two times in the script action. What is the problem. The line: xmlData.load ("get_max_sess.php"); is very good. I stuck one on one-loadVariablesNum ('get_max_sess.php', 0, 'POST'); After the fact and that do not work. is there a confilct by calling the same file twice? The function sendAndLoad isn't an option? My php file is included below.

    Thank you very much. I really hope you can help me!

    ****************************************************ACTION SCRIPT**********************************

    {call_btn.onRelease = Function ()}

    function processXMLData (success)
    {loadVariablesNum ('get_max_sess.php', 0, 'POST');}
    If (success)
    {


    var rootNode = this.firstChild;

    var contentNode = findNode (rootNode, "guit_vol");
    guitVol = getValue (contentNode);

    var authorNode = findNode (rootNode, "guit_pan");
    guitPan = getValue (authorNode);

    var contentNode = findNode (rootNode, "guit_vis");
    visGuit = getValue (contentNode);

    _root.guitVis.gotoAndStop (visGuit);

    affect of musician objects xml information

    _root.guitObj.drag._y = guitVol;
    _root.guitObj.drag._x = guitPan * 2;


    }

    on the other

    {
    Content = "today's news is not ';
    }

    }

    function getValue (node)
    {
    If (node & & node.firstChild)
    Return node.firstChild.nodeValue;
    Return ' ';
    }

    function findNode (node, nodeName)
    {
    If (node.nodeName is nodeName)
    return the node;
    for (var i = 0; node.childNodes & & I < node.childNodes.length; i ++)
    {
    var foundNode = findNode (node.childNodes , nodeName);
    If (foundNode! = null)
    Return foundNode;
    }
    Returns a null value.
    }

    var xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad=processXMLData;//when xml data loads that runs the function above
    xmlData.load ("get_max_sess.php"); load the XML from this location

    Stop();
    }

    ****************************************************PHP FILE**********************************



    <? PHP

    user_id $= $_POST ['user_id'];

    database query for records
    $connection = mysql_connect ('localhost', 'm27849_martin', 'Geraldine1') or die ("cannot
    to connect! ») ;
    mysql_select_db('m27849_liveroom') or die ("cannot select database!");
    $query ="
    SELECT a.guit_sess_id, a.guit_vol, a.guit_pan, a.guit_vis, b.bass_sess_id, b.bass_vol, b.bass_pan, b.bass_vis, c.drum_sess_id, c.drum_vol, c.drum_pan, c.drum_vis
    OF guit_info a, bass_info b, drum_info c, users_sessions d
    WHERE d.session_id = (SELECT max (a.session_id) FROM users_sessions a WHERE a.user_id = ' $user_id ')
    AND a.guit_sess_id = d.session_id
    AND b.bass_sess_id = a.guit_sess_id
    AND c.drum_sess_id = b.bass_sess_id
    ";
    (SELECT userid from auth WHERE username = "martin")
    Insert here a variable to call the relevant line (session)
    $result = mysql_query ($query) or die ("' error in query: $query.". ")
    mysql_error());

    $doc = new DomDocument ('1.0');
    The first item we create in the XML document is known as the root element. Each must have 1 and 1 single element XML document root. In this example I have called 'root', but you can use any name you like (such as the name of the PHP script that runs). Note that you need to create the item and insert it in the document with two functions.
    create the root node


    While ($row = {mysql_fetch_assoc ($result))}
    $user = $doc-> createElement('session');
    $user = $doc-> appendChild ($user);

    foreach ($row as $fieldname = > $fieldvalue) {}
    Note that here I create a new item for the field and then insert it as a child of the database line current, such as identified in $occ.
    $child = $doc-> createElement ($fieldname);
    $child = $user-> appendChild ($child);

    Now, I have to add the value of the field as a text node, then inserted as a child of the current node of the field, as identified in $child.
    $value = $doc-> createTextNode ($fieldvalue);
    $value = $child-> appendChild ($value);
    These loops are not completed as long as they treated each column of each row that has been retrieved from the database.
    } / / foreach
    } / / While



    echo $doc-> saveXML();
    echo $doc-> saveXML ($child);

    mysql_close ($Connection);


    from: http://www.tonymarston.net/php-mysql/dom.html
    ? >

    Hello
    I broke down after a lot of back and forth and the-ING! Apparently, you CAN send a variable and then load the xml. Thanks a lot for your advice and your interests. I am very grateful.

    Marty group

    Discover my code below...

    user_id = 147;
    {submit_button.onRelease = Function ()}

    function processXMLData (success)
    {
    If (Success)
    {_root.status_id = "Success"

    var rootNode = this.firstChild;

    var contentNode = findNode (rootNode, "guit_vol");
    guitVol = getValue (contentNode);

    var authorNode = findNode (rootNode, "guit_pan");
    guitPan = getValue (authorNode);

    var contentNode = findNode (rootNode, "guit_vis");
    visGuit = getValue (contentNode);

    Batch = visGuit;

    etc...

    }

    on the other

    {
    Content = "today's news is not ';
    }

    }

    function getValue (node)
    {
    If (node & node.firstChild)
    Return node.firstChild.nodeValue;
    Return ' ';
    }

    function findNode (node, nodeName)
    {
    If (node.nodeName is nodeName)
    return the node;
    for (var i = 0; node.childNodes & I)
    {
    var foundNode = findNode (node.childNodes , nodeName);
    If (foundNode! = null)
    Return foundNode;
    }
    Returns a null value.
    }

    var xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = processXMLData;
    xmlData.load ("get_max_sess.php");
    var id: LoadVars = new LoadVars();
    ID.user_id = user_id;
    ID. UserName = _root.username;
    id.sendAndLoad ("get_max_sess.php", xmlData, "POST");
    }

    Basic idea of http://www.permadi.com/tutorial/flashXMLNewsExample/index.html - thanks!

  • Variables between executions of compensation

    Hello

    I'm pretty new to LABVIEW.

    When I run the VI several times it sometimes clears the output fields (for example, a table or a string) and sometimes prevents the results of previous races.

    How can I clear the variables between tracks?

    Thanks in advance

    Yuri

    iurik wrote:

    Hello

    I'm pretty new to LABVIEW.

    When I run the VI several times it sometimes clears the output fields (for example, a table or a string) and sometimes prevents the results of previous races.

    How can I clear the variables between tracks?

    Thanks in advance

    Yuri

    Several ways

    1. you can initialize values before each session

    2. you can use Reset all to default (Invoke node)

    Clear understanding of its best to share the code for

  • How to transfer the text value of the element with the character of new line between pages?

    Hello

    I use the Application Express 4.2.2.00.11 on the 11g XE database. In my application, I use the transfer of certain values deposited between pages on a lot of places in my application. But now I have a specific problem with a textarea element.

    I have the page with the textarea element and I transfer element value to another page using the link button. I use "Set these elements" "with these values" mechanism.

    Everything works fine until I try to add the new line character in the area of the text box to be transferred to another page. I get this error message when I try

    Contact your administrator for the application. The checksum calculated on the basis of the application, clear the cache, names of arguments and argument values (711P711_TEXTabc CRC [A55D4D4B325E23CB83EF28FB7671E8F0]) does not match the checksum passed to the procedure of show (23CC724ADDA630B6F3BDFD2FEE1498E0). Note: users receive a different error message.

    Transfer of value to another implementation of page when I 'abc cde' in the text box.

    Transfer of value to another page do not work when I 'abc [line break] cde' in the text box.

    Value of transfer with the new line character point works when I change "Arguments must have checksum" "Unrestricted" on the landing page. But I want to use the shared services provider and do not want to disable checksum calculation.

    It seems that there is a bug in the function of calculation of sum of internal control...

    You have some tips?

    Cardel wrote:

    I use the Application Express 4.2.2.00.11 on the 11g XE database. In my application, I use the transfer of certain values deposited between pages on a lot of places in my application. But now I have a specific problem with a textarea element.

    I have the page with the textarea element and I transfer element value to another page using the link button. I use "Set these elements" "with these values" mechanism.

    Everything works fine until I try to add the new line character in the area of the text box to be transferred to another page. I get this error message when I try

    Contact your administrator for the application. The checksum calculated on the basis of the application, clear the cache, names of arguments and argument values (711P711_TEXTabc CRC [A55D4D4B325E23CB83EF28FB7671E8F0]) does not match the checksum passed to the procedure of show (23CC724ADDA630B6F3BDFD2FEE1498E0). Note: users receive a different error message.

    Transfer of value to another implementation of page when I 'abc cde' in the text box.

    Transfer of value to another page do not work when I 'abc [line break] cde' in the text box.

    Value of transfer with the new line character point works when I change "Arguments must have checksum" "Unrestricted" on the landing page. But I want to use the shared services provider and do not want to disable checksum calculation.

    It seems that there is a bug in the function of calculation of sum of internal control...

    You have some tips?

    This is one of the many reasons why it is inappropriate pass strings of characters between the pages through the URL. Instead of using a redirect button, change the button to send the page, then use the conditional calculations to set the values on the landing page and finally access the page using a conditional on submit: before Validation: (after calculation and before Validation and treatment) branch. When you press button terms of use on the calculations and the direction.

  • is it possible to reuse variables between sem_match queries?

    Hello

    I saw examples of the list of the variables in sparql queries link. I'm curious to know if it is possible to bind variables between sem_match queries. Please advice. Thank you very much in advance.

    Hong

    Hong,

    For the scenario you describe, you need to add code to the loop on the first request and then link and run the second query for each result. Similar Java code would be necessary for adapter Jena variables lie as well.

    SQL> set serverout on;
    declare
      type ctype is ref cursor;
      c       ctype;
      emp_uri varchar2(4000);
      email   varchar2(4000);
    begin
    
      dbms_output.put_line(chr(10));
    
      open c for
        'select x
         from table(sem_match(
         ''SELECT *
           WHERE
           { ?x rdf:type  }''
         ,sem_models(''m1'')
         ,null,null,null,null
         ,'' ''))';
      loop
        fetch c into emp_uri;
        exit when c%notfound;
    
        MY_CTXT_PKG.set_attribute('name','<' || emp_uri || '>');
    
        execute immediate
         'select e
          from table(sem_match(
          ''SELECT *
            WHERE
            { ?x   ?e
              FILTER (sameTerm(?x,oraextf:myCtxFunc("name")))}''
          ,sem_models(''m1'')
          ,null,null,null,null
          ,'' ''))'
        into email;
    
        dbms_output.put_line('email=['||email||']');
    
      end loop;
      close c;
    
    end;
    /
    SQL>   2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   26   27   28   29   30   31   32   33   34   35   36   37   38   39   40   41   42   43 
    
    email=[[email protected]]
    email=[[email protected]]
    email=[[email protected]]
    email=[[email protected]]
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.07
    SQL>
    

    In order to reproduce the example of adapter Jena in the docs, you can use three values different session (name1, name2, Name3) to bind in three values at once.

    SQL> exec MY_CTXT_PKG.set_attribute('name1','');
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.00
    SQL> exec MY_CTXT_PKG.set_attribute('name2','');
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.01
    SQL> exec MY_CTXT_PKG.set_attribute('name3','');
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.00
    SQL>
    SQL> select e, t
      2  from table(sem_match(
      3  'SELECT *
      4   WHERE
      5    { ?x     ?e .
      6       ?x rdf:type ?t
      7       FILTER (sameTerm(?x,oraextf:myCtxFunc("name1")) ||
      8           sameTerm(?x,oraextf:myCtxFunc("name2")) ||
      9           sameTerm(?x,oraextf:myCtxFunc("name3")) )
    10    }'
    11  ,sem_models('m1')
    12  ,null,null,null,null
    13  ,' '));
    
    E                   T
    ------------------------------ ------------------------------
    [email protected]               OracleHQEmployee
    [email protected]            OracleHQEmployee
    [email protected]            OracleHQEmployee
    
    Elapsed: 00:00:00.14
    

    Hope this helps,

    Matt

Maybe you are looking for