Send table to CFC

Hello

I'm stuck sending an array of CFCS. I defined the Bay on mxml like;
[Bindable] private var questionData:Array;

And adding new items;
questionData [questionData.length] = [{questionTxt:txtQuestion.text, answerTypeID:answerTypeID.selectedItem.data, isActive:isQuestionActive, answerData:answerData}];

Then I loop in my table and create one with validation, formatting, etc. It works fine, I can test my shape perfectly.

Now, I need these data to be sent to a CFC in CF and written in a table. I use the following Flex + CF code to debug everything first what I get, but it does not work.

-FLEX-
"" < mx:WebService id = "CSService" wsdl = " http://www.mytestsite.com/ws/cs_service.cfc?wsdl" showBusyCursor = "true" >
< mx:operation name = "SaveFormData" result = "saveFormDataResult (event)" >
< mx:request >
{questionData} < argFormData > < / argFormData >
< / mx:request >
< / mx:operation >
< / mx:WebService >

-CFC-
< cffunction = "SaveFormData" access returntype = name 'remotely' = 'none' index = "Save CS Form data to the database." >
< name cfargument = "argFormData" type = "array" required = "Yes" hint = "form data are mandatory" >
< intrusion via cfmail = "[email protected]" subject = "[email protected]" = "DEBUG]" type = "html" >
< cfdump var = "#arguments #" >
< / intrusion via cfmail >
< / cffunction >


I get this error at the test swf;
[Fault faultString = "HTTP request error" RPC faultCode = "Server.Error.Request" faultDetail ="error: [IOErrorEvent type ="ioError"bubbles = false cancelable = false eventPhase = 2 text =" Error #2032: stream error. "]] ["URL: https://admin.metroclubkart.com/webservice/cs_service.cfc ']. ["URL: https://admin.metroclubkart.com/webservice/cs_service.cfc ']

When I change the type of the string argument;
< name cfargument = "argFormData" type = "string" required = "Yes" hint = "form data are mandatory" >
I get the email of debugging in the form [object] [object]

I'm probably not able to send my questionData as table. Searched the forums and other sites but could not find a usable information. Any help is appreciated.

Thanks in advance.

Hi Ben,

I actually solved my problem and want to tell you what I did wrond, may help others too.

I use this code to add items to the table, but I actually use structure. Here it is warmer then always if I missed this :)
answerData [answerCount] = [{answerID: '0', answerTxt:txtAnswerTxt.text, answerPoint:txtPointTxt.text, answerIsActive:isAnswerActive, answerOrderBy: "0"}];

After adding questions and answers to structure I use an Analyzer to analyze this structure as a visible and controlled form that can check length min, restrict the tanks, len max, etc. While I am the analysis I've analyzed this structure in a table to use to the webservice. Creates a new table as [Bindable] private var webServiceData:Array = new Array; and entering the data into it during the analysis to the screen in my parser function. So whenever a question is entered, a new data entered for my structure--> them my Analyzer works--> parsed data in a visible form for interaction with the user and also you enter the data into a new table for webservice.

I could have change my code to use the table for the parser and add question, remove features of the issue, but it's easier to use structured arrays and is not a problem to write line 4-5 of the code anyway. Also when receiving data from the server I use XML and structured table conversion. Structured table are easier to work with than the table and you have to remember which part of table contains data like question [1] [5], but instead, you can use .questionID to question [1].

Which path I chose is not serious because this part of my application runs for administrators and will not be used much so I don't have a performance problem. But according to your request you may need another solution for the performance. This solution works very well for me so far.

Best regards.

Tags: Flex

Similar Questions

  • Send table of C++ to QML

    Hi, I want to send an object in C++ to QML so that when received by QML, it'll be like table variant.

    Is this possible? How to build a QVariant to contain the array of integers?

    Also, when I use QVariant as return type:

    Q_INVOKABLE QVariant getArrayId();
    

    the file o.le - v7 - g gets marked for error without any description of the cause.

    use a QStringList - will be converted into a table in QML

  • Send table to PHP with HTTPService

    How can I send a picture via HTTPService to a PHP script please?
    If I do this:

    var params: Object = new Objsect();
    params.myData = myDataArray; dataArray is a var table I need to send
    myService.send (params);


    He's not on a table.
    How can I pass the array to PHP?

    You can convert the table to a string in FLEX and PHP, you can use the command "split"...

    Here's example program to see if it helps u

    http://flexarraytransfer.blogspot.com/

  • Problem sending table 2D via TCP/IP

    Hello to all 2!

    Attached the vi using, I'm trying to send and receive a picture 2d over tcp/ip, but I get an "out of memory" error of LabView.

    Where is the problem?... I adapted the examples provided by neither, but somewhere, there seems to be a problem.

    4 thank you for your time!

    P.S. I use LabView 8.5.1 on Windows XP SP2

    I made a few changes to your TCP - transmit .vi, see attachment. He should be executed normally.

  • How to send the picture of u with labview

    Hello

    How to send table unsigned 32-bit via UDP.

    How to convert the 32-bit unsigned byte array table.


  • Error calling CFC {path to the cfc} Internal Server Error

    I have a CFC bind cfgrid passing page, pagesize, etc... some search entered to a cfc function. I have a cfgridcolumn which is a checkbox column (display checkbox images in as the column and I have a Javascript click here for images to the box unchecked/enabled the user will treat as a checkbox if it's pictures of box). I have more than 1,000 records in the grid and I have a drop down for the check all button the cfgridcolumn passing whole entity ID to a javascript function that creates a proxy cfajax call to invoke a cfc method and post these identifiers to this method, this method receives all the ID of 1000 + entity to a temporary table and invoke an oracle stored procedure changes in the table and Finally my grid refreshes as well as I can see that are all checked images of the check box in the controls cfgrid. It works very well in my localhost (CF 9 + Windows + Jboss) but everything by moving files to the Dev (CF 9 + Linux + Apache) Server I get error invoking CFC's internal server error. What is interesting is if I spend less than 500 ID entity that it works very well in Dev server. Why it does not work if I spend more than 500 feature ID.

    Thanks for your reply. I had solved it. I spent all of the 1000 + entity ID as an a list separated by commas to the FCC who does not like in a Linux environment. So I changed to a table object instead of comma-separated list values and pass it as an argument of table to CFC. Now, it works fine.

  • Pass data between applications value reference

    The issue is that data application reference value is local to the application instance, or can be transferred between different applications.

    I have a main application that acquires the table of 100 MB and I need to use these data in a dll. Obviously, I don't want to send table, reference would be better. Both applications are generated in labview 2011.

    The second question is whether reference data value can be converted to a string (type cast or flatten to a string) and back. For example with DAQmx tasks flatten to a string does not work.

    Alexander_Sobolev wrote:

    It's value application data reference is local to the application instance.

    Yes.

    or may be transferred between applications.

    Laughing out loud

    The second question is whether reference data value can be converted to a string (type cast or flatten to a string) and back.

    Yes, but only means something in the app instance appeared to reference.

    You will want to perhaps give more details on what are your real needs, but keep in mind that play with memory directly in LV is not so simple, as he does all he can to hide these details you.

    If you pass a pointer to an array to a DLL, you can configure the DLL for this call. If you want to get an accurate picture of LV in memory address and passing around, this isn't something LV supports and you shouldn't do that because the memory should not be controlled by more than one master at any time in time.

    LV has functions of memory allocation and to get the pointer back, but requiring explicit calls.

    Anyway, I have no real experience with this. If you want to read materials, there are at least two users here with much more knowledge on the subject and you can go through their messages or search and filter for their post - rolfk and nathand.

  • Interfacing of the host target

    Hi all

    I just started the LabView. I want to send table 1 d of the host to the fpga VI. I want that all the values in the table in the table 1 d from FPGA VI. Could u please help me to do the same.

    Hello

    There are two methods of transfer of data from your host to the target FPGA.

    1 flatten/Unflatten

    2 whole Handshaking

    You can find details on how to implement these solutions in the following NI Developer Zone article:

    http://zone.NI.com/DevZone/CDA/tut/p/ID/4520

    Hope this helps

    Rohit

    NEITHER the India

  • Use &lt; cfajaxproxy &gt; to handle the form submission?

    ColdFusion 9

    Im trying to submit a < cfform > function CFCs without appellant cfm refreshing. The name of the form is dynamic, and so are the elements contained in the form. Javascript seems to pass the form as a structure to my cfc, but the < select > and < textarea > are empty.

    ------------------------------------------------------------------------------------------ ------------------------

    < cfform id = method "" #randomID # "="post">"

    < name cfselect = "PremierElement" >

    < = "firstOption" value = "firstValue" option name > first option < / option >

    < name of option = "secondOption" value = "secondValue" > second option < / option >

    < / cfselect >

    < cftextarea type argument = "text" name = "textAreaOne" rows = "5" cols = "45" > < / argument cftextarea >

    < name cfinput = "submit" type = "button" value = "Send" onClick = "sendForm('#randomID#')" >

    < / cfform

    This is the javascript function that is called by the form:

    (The .cfc's formAction.cfc)

    ------------------------------------------------------------------------------------------ ------------------------

    < cfajaxproxy cfc = "culture" jsclassname = "cfcClass" >

    < script type = "text/javascript" language = "javascript" >

    function sendForm (formID) {}

    var cfc = new cfcClass();

    This seems to send the form as a structure of my cfc, but the < select > and < textarea > are empty

    var result = cfc.send (formID);

    }

    It's the CFC:

    ------------------------------------------------------------------------------------------ ------------------------

    < cfproperty >
    < name cffunction = 'send' returntype = "remote access" = "string" >
    < name cfargument = "formResults" type = "struct" required = "yes" >


    < cfreturn >
    < / cffunction >
    < / cfproperty >

    ------------------------------------------------------------------------------------------ ------------------------

    My goal here is to pass the form to the cfc as a structure. I can then loop through the structure and create a list of keys and values. I also tried to create a chain of values in javascript before the call to cfc code, but ive problems, because a large part of each form is dynamic.

    ------------------------------------------------------------------------------------------ ------------------------

    Here is my attempt to extract the form values before calling cfc:

    function sendForm (formID) {}

    to loop through the form in question

    for (i = 0; i < document.getElementById (formID).elements.length; i ++) {}

    This works for items imput simple but not for < select >

    var value = document.getElementById (formID) [i] .value;

    for < select > ive tried this, but the selectedIndex property is always 0:

    var value = document.getElementById (formID) [i] SelectedIndex;

    ------------------------------------------------------------------------------------------ ------------------------

    If someone could help me with another method; Send the form to the cfc, or create a list of values to send to the cfc structure, I'd be a very happy man.

    There is an easier way to your cfc without home page refresh.  Submit your form to a .cfm page within a very small iframe.  Then this .cfm file can send the form as a structure to your PPC.

  • byteArray to the file binary cffile

    Hello

    I can't try to write AS3 to take a screenshot on an MC who is on the scene and transmit data to a .cfc method that saves in a jpg on the server. The current code I kind of work except the jpg is unreadable. I think it has something to do with the not not using Flex, AMF and writes binary files. When I look at the jpg via a hex viewer, according to me, it doesn't have the header right jpg. 

    The jpg begins with:
    C3 c3 c3 c3 a0 00 10 4 a 46 98 bf bf

    When I think it should start with:
    FF d8 ff e0 00 10 4 a 46

    AS3 source code

    import flash.net.NetConnection;
    import flash.net.Responder;
    Import 12345678910111213import;
    import flash.display.BitmapData;
    import flash.utils.ByteArray;
    import com.dynamicflash.util.Base64;
    import com.adobe.images.JPGEncoder;


    var myService:NetConnection = new NetConnection();
    var myStruct:Object = new Object;  to pass arguments to the cfc
    var hostSite:String;

    hostSite = "test.somedomain.com";
    myService.objectEncoding = 0;
    myService.connect ("http://" + hostSite + "/ flashservices/gateway" "")

    sketch_mc is source MC we would like to take a snapshot, which is already on the scene.
    var jpgSource:BitmapData = new BitmapData (sketch_mc.width, sketch_mc.height);
    jpgSource.draw (sketch_mc);
    var imgEncoder = new JPGEncoder (90);
    var jpgStream:ByteArray = imgEncoder.encode (jpgSource);

    saveImg (jpgStream);

    function saveImg(jpg:ByteArray) {}
    trace ("send image to cfc");
    var code: String = Base64.encode (jpg.toString ());
    myStruct.jpgDataString = encoded;

    var responder: responder = new responder (saveImg_Result, onFault);
    myService.call ("latestVersion.secure.saveImage", responder, myStruct);
    }
    function saveImg_Result (result) {}
    trace ("Image sent result:" + result)
    }
    function onFault (e) {}
    trace ("Error:" + f.description);
    }

    <! - .cfc source - >
    < cfproperty >

    < cffunction = output "saveImage" name = "' access returntype ="remote"="any">
    < name cfargument = "jpgDataString" type = "string" required = "yes" >
    < cfset img = toBinary (arguments.jpgDataString) >
    "< cffile action ="Write"accept ="image"file ="d:\test.jpg"output =" #img # "nameconflict ="overwrite"/ >
    < cfreturn "Recorded Image" >
    < / cffunction >


    < / cfproperty >

    Think you can use Base64.encodeByteArray in your SAVEIMG function.

    var code: String = Base64. encodeByteArray (jpg)

    myStruct.jpgDataString = encoded;

    Server-side, you would need decode the base64 string. I guess that's what this:

  • Missing data recordset of the emails.

    (David gave me help with this page a few days ago, and I thought that I've sorted, but still a problem. I reduced the offending code)

    I've set up a page that presents data from a MYSQL dbase and then sends the information, as an email when there is an e-mail address of the recipient. He also sends an e-mail notification.
    As you can see below the Recordset (restSelect) is selected by the receipt of a numeric variable posted since a previous page.
    The page works insofar as the correct data are drawn from the dbase and presented on the Web page, but when emails are sent as messages arrive without the news of dbase.
    I don't understand why e-mail messages are not collecting the data recordset. Can you see where I'm wrong, please?
    (php written largely by DW2004)

    Here is the code:

    <? PHP require('.. /.. / Connections/tormented3.php');? >
    <? PHP
    $colname_restSelect = "1";
    If (isset($_POST['org_pk'])) {}
    $colname_restSelect = (get_magic_quotes_gpc())? $_POST ['org_pk']: addslashes($_POST['org_pk']);
    }
    @mysql_select_db ($database_tormented3, $tormented3);
    $query_restSelect = sprintf ("SELECT * FROM cel_contents WHERE cel_pk = %s", $colname_restSelect);
    $restSelect = mysql_query ($query_restSelect, $tormented3) or die (mysql_error ());
    $row_restSelect = mysql_fetch_assoc ($restSelect);
    $totalRows_restSelect = mysql_num_rows ($restSelect);

    If (isset($_POST['send'])) {/ / 'submit' is the name of the submit button}
    $error = ";

    process and validate a field:
    $email1 = trim($_POST['email1']);
    if($email1 == '') {/ / if the name is blank, displays an error message (us and for required fields)}
    $error. = ' < style p = "color: red;" > you missed your email address! < /p > '; error message
    }

    if($Error == '') {/ / If no error, the form process}

    Mail script
    $org = $row_restSelect ["cel_org"];
    $tel = $row_restSelect ["cel_tel"];

    $message = "Thank you for requesting information on the $org.\n\n." Configure the e-mail message to the customer.
    $message. = "contact information: \n";
    $message. = "Such no $tel \n";

    $inform_me = "details of the $org have been sent to $email1; Set up the email informing me of the request for information.
    E-mail:
    If (mail ("$email1", $org, $message, "from: www.somewhere.org.uk") & & mail ("[email protected]", $org, ))
    (($inform_me, "from: www.somewhere.org.uk"))
    {
    header ('location: http://www.somewhere.org.uk/feedback/email_redirect.php "") ;// Redirect to the page if the email has been sent successfully
    "exit";
    } else {}
    $error == ' < style p = "color: red;" > an error has occurred, your email could not be sent. Please try
    new / < p > ';
    }
    }
    }
    ? >
    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""
    " < html xmlns =" http://www.w3.org/1999/xhtml ">
    < head >
    < title > < /title > feedback form
    < meta http-equiv = "Content-Type" content = text/html"; charset = iso-8859-1 "/ >"
    < script type = "text/javascript" src = "fb.js" > < / script >
    "" < link href = "... / css/mentalhealth_bx.css" rel = "stylesheet" type = "text/css" / >
    < / head >
    < body class = "grey_bground" >

    < form action = "<?" PHP echo $PHP_SELF;? ">" method = "post" name = "email1" id = "email1" >
    <? PHP echo $error;? >
    <!--appeal the processing routine-->
    < div id = 'wrapper' > <! - this div code appears sometimes red in DW because there are closing 2/div (see below) - >
    < table class = "whitecell" cellpadding = "1" >
    < b >
    < td colspan = "4" class = "cellcolour" > < p align = "center" class = "redhaed" > NB Ce e-mail form does not yet properly < /p >
    < p align = "center" class = "strongbody" > use this form to send the information below on < span class = "redhaed" > <? PHP echo $row_restSelect ["cel_org"];? > < / span > for yourself or for someone else < br / >
    by entering the relevant address in the space below. < br / >
    < /p >
    < table >
    < /tr >
    < b >
    < td align = "right" > < p > < / p >
    < p > < /p > < table >
    < td colspan = "3" valign = "top" > <? PHP echo $org_pk; temporary control? > < table >
    < /tr >
    < b >
    < td align = "right" > < span class = "right_cell" > information about < / span > < table >
    < td colspan = "3" valign = "top" > <? PHP echo $row_restSelect ["cel_org"];? > of < table > www.somewhere.org.uk
    < /tr >
    < b >
    < td colspan = "4" align = "right" > < table >
    < /tr >
    < b >
    < td align = 'right' class = "right_cell" > Tel.no. < table >
    < td > <? PHP echo $row_restSelect ["cel_tel"];? > < table >
    < /tr >
    < b >
    < td valign = "top" class = "right_cell" > < table >
    < td valign = "top" > < table >
    < /tr >
    < b >
    < td colspan = "4" valign = "top" > < table >
    < /tr >
    < b >
    < td align = 'right' class = "cellcolour" >
    E-mail address of the recipient: < b > < br / >
    < /b > < table >
    < td > < input name = "email1" type = "text" size = "40" value = "" / > "
    "< input name ="send"type ="submit"value =" send "/ >"
    < table >
    < /tr >
    < b >
    < td colspan = "2" > < div align = "right" > < / div > < table >
    < /tr >
    < /table >
    < / div >
    < / make >
    < / body >
    < / html >
    <? PHP
    mysql_free_result ($restSelect);
    ? >

    Thank you very much for looking.
    Steve

    The problem is that $_POST ['org_pk'] comes from the previous page. $_POST and $_GET variables are sent only to the next page. They are not kept indefinitely. For example, when the form is submitted, $_POST ['org_pk'] no longer exists.

    To work around this problem, add the following line somewhere inside your form:

    
    

    It stores the value of $_POST ['org_pk'] in a hidden field and include in the array $_POST when sending the form.

  • Getters and Setters is not necessary?

    According to one training with Ben Forta videos, I can build a .cfc mapped my CF9 on a specific table with fields as follows:

    Component name: name of the Table BAA_SBJ.cfc: BAA_SBJ

    ----------------------------------------------------------------

    < cfproperty persistent = "true" >
    < name cfcomponent = column "SRC_SYS_NM" = "SRC_SYS_NM", datatype = "string" length = "50" / >
    < name cfcomponent = column "SRC_SYS_GUID" = "SRC_SYS_GUID", datatype = "string" length = "39" / >
    < name cfcomponent = column "OBJ_GUID" = "OBJ_GUID", datatype = "string" length = "39" / >

    < name cfcomponent = column "SBJ_NM" = "SBJ_NM", datatype = "string" length = "100" / >
    < name cfcomponent = column "SBJ_DOB" = "SBJ_DOB" datatype = "date" length = "10" / >
    < name cfcomponent = column "SBJ_ID" = "SBJ_ID", datatype = "string" length = "100" / >
    < name cfcomponent = "NOTE" column = 'NOTE' datatype = 'clob' length = "2147483" / >

    < cfcomponent name = the column "CDT" = "CDT" datatype = "date" length = "10" / >
    < cfcomponent name = "MC" column = "MC" datatype = "timestamp" length = "8" / >
    < name cfcomponent = "CBY" column = "CBY" datatype = "string" length = "25" / >
    < name cfcomponent = "MDT" column = "MDT" datatype = "date" length = "10" / >
    < name cfcomponent = "MTM" column = "MTM" datatype = "timestamp" length = "8" / >
    < name cfcomponent = "MBY" column = "MBY" datatype = "string" length = "25" / >
    < / cfproperty >
    -------------------------------------------------------------------

    Because the name of the component and the table name are the same, this mapping code will automatically create 'Getters and Setters' which means that I can, in an index.html page, use the following code without manually declare a function "GetSUB_NM", because CF9 does this for me automatically:

    < cfset data = EntityLoad ("BAA_SBJ_NM") >
    < = cfloop '1' to = "#ArrayLen (data) ' # ' index 'i' = >"
    < cfoutput >
    #data [i]. GetSBJ_NM() # < br >
    < / cfoutput >
    < / cfloop >

    -------------------------------------------------------------------

    -However, in the instructions http://www.Adobe.com/devnet/flex/articles/fcf_ataglance_flex_coldfusion.html   -------------

    It describes how to explicitly declare inserts updates and deletes functions.

    <cfcomponent>
      <cffunction name="getEmployees">
        <cfargument name="region" type="string" />
        <cfquery datasource="F4CF_FictitiousSalesPlanner"
          name="qEmployees">
          SELECT FirstName, LastName, Email, Phone, Region
          FROM SalesTargets
          <cfif isDefined("arguments.region")>
            WHERE Region = '#arguments.region#'
          </cfif>
        </cfquery>
        <cfreturn qEmployees>
      </cffunction>
      <cffunction name="insertEmployee">
        ...
      </cffunction>
      <cffunction name="updateEmployees">
        ...
      </cffunction>
      <cffunction name="deleteEmployee">
        ...
      </cffunction>
    </cfcomponent>

    --------------------------------------------------------------------------------

    I read the outdated documents?  I was under the impression that if I use a FB4 project/component connected to a .cfc with a corresponding name of the table (but that is done, I don't know at this point), that CF9 would just understand on his own if there is a demand an insert, a delete or update.  Which is the correct way to more modern to connect, say a data grid, of a cfc to CF9?    Having to write insert(), update(), function delete() to each table in my database manually, seems redundant, as 100% of the time, I need the same functions on all the tables.

    Unless there is something 'new' in FB4 that I do not know, you cannot directly access the Coldfusion ORM functions

    to in actionscript as you cannot access or directly from actionscript, then you

    need remote access component of CF which has functions that call functions of the CF ORM like EntityLoad, EntitySave, etc.

    Answer a couple of your questions with this premise:

    1. your FB4 "object of value" would connect to your coldfusion 'entity' cfc.

    2 getters/Setters are created automatically in your entity of cfc, you can ensure

    This setting parameters, i.e. the accessor = "true" in your component of the entity.

    3. you can set the parameter 'table' in your component of the entity, or you can leave

    out if the name of your entity corresponds to the table you can leave, just like you can leave out

    the column names if your properties match the DB fields that did yours.

    4. the remote component which calls FB4 should have functions that

    accept valuable FB4 for saves and deletes, and these functions call the correct entity function,

    That is to say, EntitySave, EntityDelete or EntityLoad with filter settings.

    6. your remote component functions do not need to have statements, access DB is managed

    by the Coldfusion ORM functions such as you have in your CFML example.

    Thus the functions of your remote control would look like 'something' this...

  • PHP Mail with session variables

    Here is the code for an email to collect page, which sends two session variables (email and postal code) to an email_sub.php page (data are inserted in MySQL). After submitting the form, I get the email_sub.php? page where this code works normally

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

    <? PHP echo $_SESSION ['postal code'];? >

    However, when the email is sent, the "subject" and the "To" is successfully sent, but not the variables $email and $zipcode.

    From:
    Zip code:

    If I hard code for values of and Zip, they appear in the email. It seems therefore that session variables are not available at the email_sub.php page.

    If anyone can point me in the right direction for a fix, I'd be very happy to suggestions.

    email_collect.php

    <? php require_once('Connections/connMan.php');? >
    <? PHP
    session_start();
    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    $theValue = (! get_magic_quotes_gpc())? addslashes ($TheValue): $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;
    }

    $editFormAction = $_SERVER ['PHP_SELF'];
    If (isset {}
    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);
    }

    If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "form1")) {}
    $email = $HTTP_POST_VARS ['email'];
    session_register ("email");
    $zipcode = $HTTP_POST_VARS ["zipcode"];
    session_register ("zipcode");
    $insertSQL = sprintf ("INSERT INTO email_list (e-mail, postal code) VALUES (%s, %s)," ")
    GetSQLValueString ($_POST ['email'], "text").
    GetSQLValueString ($_POST ['PostalCode'], "int"));

    @mysql_select_db ($database_connMan, $connMan);
    $Result1 = mysql_query ($insertSQL, $connMan) or die (mysql_error ());

    $insertGoTo = "email_sub.php";
    If (isset {}
    $insertGoTo. = (strpos ($insertGoTo, '?'))? « & » : « ? » ;
    $insertGoTo. = $_SERVER ['QUERY_STRING'];
    }
    header (sprintf ("location: %s", $insertGoTo));
    }

    @mysql_select_db ($database_connMan, $connMan);
    $query_rsEmailer = "SELECT * from email_list";
    $rsEmailer = mysql_query ($query_rsEmailer, $connMan) or die (mysql_error ());
    $row_rsEmailer = mysql_fetch_assoc ($rsEmailer);
    $totalRows_rsEmailer = mysql_num_rows ($rsEmailer);
    ? >
    < ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional / / IN" "http://www.w3.org/TR/html4/loose.dtd" > ""
    < html >
    < head >
    < title > em touch all the Camps of Baseball < /title >
    < meta http-equiv = "Content-Type" content = text/html"; charset = iso-8859-1 ">"
    < link href = "assets/taylor.css" rel = "stylesheet" type = "text/css" > "
    < script type = "text/JavaScript" >
    <!--
    function MM_findObj (n, d) {//v4.01
    var p, i, x;  if(!d) d = document; If ((p = n.IndexOf ("?")) > 0 & & parent.frames.length) {}
    d = parent.frames [n.Substring(p+1)] .document; n = n.Substring (0, p) ;}
    If (!) () x = d [n]) & & copyrights) x = d.all [n]; for (i = 0;! x & & i < d.forms.length; i ++) x = d.forms [i] [n];
    for (i = 0;! x & & d.layers & & I < d.layers.length; i ++) x = MM_findObj (n, d.layers [i] .document);
    If (! x & & d.getElementById) x = d.getElementById (n); Return x;
    }

    function MM_validateForm() {//v4.0
    var i, p, q, n, test, num, min, max, errors = ", args = MM_validateForm.arguments;
    for (i = 0; I <(args.length-2); I += 3) {test = args [i + 2]; val = MM_findObj(args[i]);
    If (val) {n = val.name; if ((val=val.value)! = "") {}}
    If (test.indexOf ('isEmail')! =-1) {p = val.indexOf (' @');}
    If (p < 1 | p ==(val.length-1)) errors +='-' + nm + "must contain an e-mail address. \n » ;
    } Else if (test! = 'R') {num = parseFloat (val);
    If (isNaN (val)) errors +='-' + nm + 'must contain a number. \n » ;
    If (test.indexOf ('inRange')! = - 1) {p = test.indexOf (': ');}
    min = test. Substring(8,p); Max = test. Substring (p + 1);
    If (num < min | max < num) errors +='-' + nm + must contain a number between "+ min +" and "+ max +".. " \n " ;
    }} ElseIf (test.charAt (0) == 'R') errors += '-' + nm + ' is required. \n " ; }
    } If (errors) alert ("the following error occurred: \n'+errors");
    document. MM_returnValue = (error == ");
    }
    ->
    < /script >
    < / head >

    < body >
    < are method = "post" name = "form1" action = "<?" PHP echo $editFormAction;? > ">"
    < table width = "325" align = "center" >
    < tr valign = 'of basic">
    < td colspan = "2" align = "left" >
    < h1 class = "subtitle" > join our Email list < / h1 >
    < p > please fill in boxes and click on & quot; Send. & quot; This information is kept secret and is intended for the exclusive touch of < strong > Hank Manning em all Camps of Baseball < facilities > in order to send you the latest happenings on our calendar.
    < /p >

    < p > < / p >
    < table >
    < /tr >
    < tr valign = 'of basic">
    < td align = "right" valign = "middle" nowrap > < p > E-mail: < /p > < table >
    < td align = "left" valign = "middle" > < input name = "email" type = "text" onBlur = "MM_validateForm ('email',", 'RisEmail'); " return document. MM_returnValue"size ="32"value ="Email address"> < table >
    < /tr >
    < tr valign = 'of basic">
    < td align = "right" valign = "middle" nowrap > < p > code postal: < /p > < table >
    < td align = "left" valign = "middle" > < input name = "PostalCode" type = "text" onBlur = "MM_validateForm ('postcode',", 'RisNum'); " return document. MM_returnValue' size = '32' value = 'postal Code' > < table >
    < /tr >
    < tr valign = 'of basic">
    < td align = "right" > < input type = "reset" name = "Reset2" value = "Reset" > < br >
    < input type = "submit" value = "send" > < table > ' "
    < td > < table >
    < /tr >
    < /table >
    < input type = "hidden" name = "MM_insert" value = "form1" >
    < / make >
    < p > < / p >
    < / body >
    < / html >
    <? PHP
    mysql_free_result() will free all memory associated with the result identifier result.

    mysql_free_result() only needs to be called if you are concerned about how much memory is used for queries that return large result sets. All associated result memory is automatically freed when the script is completed.
    mysql_free_result ($rsEmailer);
    ? >

    email_sub.php

    <? PHP session_start(); It connects to the existing session

    email sent

    / / [email protected] , [email protected]
    mail (' [email protected], [email protected]', "Join Email List", "from: $email\r\n Zip: $zipcode");
    ? >
    < ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional / / IN" "http://www.w3.org/TR/html4/loose.dtd" > ""
    < html >
    < head >
    < title > em touch all the Camps of Baseball < /title >
    < meta http-equiv = "Content-Type" content = text/html"; charset = iso-8859-1 ">"
    < link href = "assets/taylor.css" rel = "stylesheet" type = "text/css" > "
    < / head >

    < body >


    < table width = "280" border = "0" cellspacing = "0" cellpadding = "0" >
    < b >
    < td colspan = "2" > < img src = "images/manning_logo.jpg" width = "426" height = "64" > < table > "
    < /tr >
    < tr valign = "top" >
    < td colspan = "2" > < p > < / p >
    < p align = "left" > thank you very much for sending your email and zip code. < /p >
    < table width = "350" border = "0" cellspacing = "0" cellpadding = "0" >
    < b >
    < td width = "69" > < p align = "right" > email: < /p > < table >
    < td width = "281" > < p align = "left" > <? PHP echo $_SESSION ['email'];? > < / p > < table >
    < /tr >
    < b >
    < td > < p align = 'right' > postal code: < /p > < table >
    < td > < p align = "left" > <? PHP echo $_SESSION ['postal code'];? > < / p > < table >
    < /tr >
    < / table > < p align = "left" > This information will be stored in our database exclusive use < facilities > < strong > Hank Manning em all the Baseball Camps Touch, which respects and protects your privacy. < /p >
    < table >
    < /tr >
    < b >
    < td width = "407" align = "left" > < a href = "javascript:window.close();" "> close this window < /a > < table >
    < td width = "19" > < p > < / p > < table >
    < /tr >
    < /table >
    < p > < / p >
    < p > < / p >
    <? PHP
    end the session so that I could see new variables because they are passed in the development
    session_destroy();? >
    < / body >
    < / html >

    sbudlong wrote:

    I made the change you suggested but the showsFrom:Zip still E-mail: without values for the variables. Is there a problem with the session?

    It seems that you do not use session variables when you send the mail:

    mail('[email protected], [email protected]',
    'Join Email List',
    "From: $email\r\n Zip: $zipcode");
    

    Change to this:

    mail('[email protected], [email protected]',
    'Join Email List',
    'From: ' . $_SESSION['email'] . "\r\n Zip: " .
    $_SESSION['zipcode']);
    
  • ColdFusion.Ajax.submitForm ResultHandler question

    I'm developing a solution Ajax based CF in which I use ColdFusion.Ajax.submitForm to pass values of form to a CFC for treatment via the Java Script. My question is related to the resultHandler of Java Script and find out if there is an easy way to return the results of the SWC to the Manager or not.

    My Java Script looks like this...
    function InsertRec() {}
    ColdFusion.Ajax.submitForm ("MyForm', ' service.cfc? method = InsertRec', resultInsertHandler, resultErrorHandler");
    }

    My CFC looks like this... (condensed)
    < cffunction "insertRec" access = output = "remote" name = "" returntype = "numeric" >
    < cfargument name = "NAME" >
    < cfargument = 'Phone' name >

    < name cfquery = "recInsert" datasource = "#request. DS #">"
    < cfset NEW_NUMBER = updatedNum () > <-get # new another table through CFC

    INSERT INTO MYTABLE
    (NUMBER, NAME, PHONE)
    Values (' #NEW_NUMBER # ',' #ARGUMENTS.NAME # ',' #ARGUMENTS.) PHONE # ')

    < / cfquery >
    < cfreturn NEW_NUMBER >
    < / cffunction >

    What I'm trying to do is to return the value of the CFC to resultInsertHandler NEW_NUMBER for I could use in a Java Script alert msg. Any ideas or thoughts would be greatly appreciated.

    Concerning

    Martin Franklin

    MMFranklin wrote:
    > What I am trying to do is to return the value of the CFC NEW_NUMBER to
    > resultInsertHandler so I can use it in a Java Script alert msg. Any ideas or
    > thoughts would be greatly appreciated.

    Something like that I guess.

    function resultInsertHandler (returnMsg)
    {
    Alert (returnMsg);
    }

  • User Message interface help - table to send to the user through ActiveX interface

    Hello

    I asked a similar question before, but now I'm having problems trying to get a table in the user interface via the mail user interface. I am my code TestStand, I have an expression to send a picture that is as a container of table of FileGlobal to the UI as such:

    RunState.Thread.PostUIMessageEx (UIMsg_UserMessageBase + 2, 0, "", FileGlobals.DataRead, False)

    and in the UImessage callback I what I thought, I have to do to send the data to an array of text on the user interface. It does not work.

    Can someone tell me what I am doing wrong?

    Is attached, the UIcallback, a picture of the table on my user interface and control


Maybe you are looking for

  • Windows 10 disconnect my ipod

    Hello everyone, I hope you can help I wanted to update songs on my ipod but when I connect it to my pc it synchronizes and then disconnects again straight away, I get a flash message saying something you need to do something with my H drive, this dri

  • Card memory locked, cannot take pictures... help!

    Hi all, hope you can help... I own a Sony Cybershot digital camera (14.1 mega pixels), model #DSC - W350. It is not in the support tech guide, so here I am. I took the camera at Wal-Mart yesterday to have fixed parameters (memory memory card internal

  • NOR-DAQmx 50103 error 'the specified resource is reserved.

    Suddenly, I get this error when I try to run my program. I looked at the page for orientation: http://digital.NI.com/public.nsf/allkb/485201B647950BF886257537006CEB89 I followed the steps for the case 1 (traditional DAQ driver reset), but I still get

  • Download Windows Media Center in Windows XP Home Edition?

    I want to download Windows Media Center in Windows XP Home Edition. I can do or do I have to install Windows XP Media Center Edition? If I install XP Media Center Edition can just move from Windows XP Home Edition?Thank you!David

  • Outlook 2007 has killed my PST, lost messages! Help, please.

    Errors were found in the file. Quit all applications to mail and then use the Inbox Repair tool. I'm having a huge problem with Outlook 2007 on Vista Home Premium 64-bit.  I recently bought a new computer and have moved my PST file to him.  When I tr