<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<div><br></div><div>Shouldn't be as it's using an event.</div><div><br></div><div> </div><br><br><div><div id="SkyDrivePlaceholder"></div>> Date: Tue, 7 Aug 2012 15:43:35 +0100<br>> From: patrick.lockley@googlemail.com<br>> To: xerte@lists.nottingham.ac.uk<br>> Subject: [Xerte] Re: Desktop Xerte 2.17 -- having trouble reading data from external script<br>> <br>> Timing issue?<br>> <br>> On Tue, Aug 7, 2012 at 3:41 PM, Paul Swanson <Paul.Swanson@harlandfs.com> wrote:<br>> > Same thing.<br>> ><br>> ><br>> ><br>> > Paul Swanson<br>> ><br>> > Internal Business Systems Analyst<br>> ><br>> > Internal Business Intelligence<br>> ><br>> > Harland Financial Solutions<br>> ><br>> > (800) 274-7280 Ext. 2462<br>> ><br>> > Paul.Swanson@harlandfs.com<br>> ><br>> ><br>> ><br>> > From: xerte-bounces@lists.nottingham.ac.uk<br>> > [mailto:xerte-bounces@lists.nottingham.ac.uk] On Behalf Of Dave Burnett<br>> > Sent: Monday, August 06, 2012 5:01 PM<br>> > To: Xerte list<br>> > Subject: [Xerte] Re: Desktop Xerte 2.17 -- having trouble reading data from<br>> > external script<br>> ><br>> ><br>> ><br>> > What if it's on an actual web server?<br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> > ________________________________<br>> ><br>> > From: Paul.Swanson@harlandfs.com<br>> > To: xerte@lists.nottingham.ac.uk<br>> > Date: Mon, 6 Aug 2012 22:39:53 +0000<br>> > Subject: [Xerte] Desktop Xerte 2.17 -- having trouble reading data from<br>> > external script<br>> ><br>> > I’m have a devil of a time getting a Xerte app to read the response from a<br>> > PHP script when run through a browser. It works fine in Preview mode, and I<br>> > know the script is getting the login information and returning a string<br>> > because in preview mode I receive and can display the correct response with<br>> > info from my database. I also have the PHP database script email me the same<br>> > string. This works beautifully in Preview mode, but when I copy my rlo and<br>> > other published files to localhost and run it from there, Xerte prints<br>> > ‘undefined’ for the rawData property returned from a sendAndLoadVars call.<br>> > The database script still emails me the correct response.<br>> ><br>> ><br>> ><br>> > Here’s what I’m sending to my PHP authentication script (domain is defined<br>> > in a login script, and the parent Page icon has an id of loginCheck):<br>> ><br>> > // real url<br>> ><br>> > URLString = domain + '/wbt/app/admin/authenticate.php';<br>> ><br>> ><br>> ><br>> > // pass values to external script<br>> ><br>> > loginVars = new LoadVars ();<br>> ><br>> > loginVars.action = 'authenticate';<br>> ><br>> > loginVars.login = username;<br>> ><br>> > loginVars.sku = sku;<br>> ><br>> ><br>> ><br>> > // send to login script<br>> ><br>> > loginCheck.sendAndLoadVars(URLString, loginVars);<br>> ><br>> ><br>> ><br>> > Following the above, I have an Interaction with an Event icon (eventName =<br>> > onSendAndLoadVars, icon = loginCheck). Attached to the event is a script<br>> > icon with:<br>> ><br>> > // initialize btnPath -- assume not authenticated<br>> ><br>> > btnPath = 1; // 1 is the fail path<br>> ><br>> > message = ''; // initialize message<br>> ><br>> > responseMessage = ''; // initialize response message<br>> ><br>> ><br>> ><br>> > rawStuff = loginCheck.rawData;<br>> ><br>> > loginInstructions.setText(loginCheck.rawData);<br>> ><br>> ><br>> ><br>> > //rawStuff = replace(rawStuff, '<sup>&reg;</sup>', '');<br>> ><br>> > rawInfoArray = rawStuff.split('&'); // save string pairs into an array<br>> ><br>> ><br>> ><br>> > for (i = 0; i < rawInfoArray.length; i++) { // break pairs into smaller<br>> > arrays and parse<br>> ><br>> ><br>> ><br>> >   tempArray = rawInfoArray[i].split('='); // split on = sign<br>> ><br>> ><br>> ><br>> >   switch (tempArray[0]) {<br>> ><br>> >     case 'reg_id':<br>> ><br>> >       sid = tempArray[1];<br>> ><br>> >       btnPath = 0;<br>> ><br>> >       break;<br>> ><br>> >     case 'message':<br>> ><br>> >       responseMessage = tempArray[1];<br>> ><br>> >       break;<br>> ><br>> >   }<br>> ><br>> ><br>> ><br>> > }<br>> ><br>> ><br>> ><br>> > debug('sid: ' + sid + '\nresponseMessage: ' + responseMessage);<br>> ><br>> > debug(loginCheck.rawData);<br>> ><br>> ><br>> ><br>> > // display appropriate response<br>> ><br>> > if (btnPath == 1) {<br>> ><br>> >   message = '<p>Could not retrieve account from the database.</p><br /><p>'<br>> > + responseMessage + '</p>';<br>> ><br>> > }<br>> ><br>> ><br>> ><br>> > I get all the expected debug info in Preview and login is successful. Debug<br>> > response is:<br>> ><br>> > sid: 71<br>> ><br>> > responseMessage: User Found in Database<br/><br>> ><br>> ><br>> ><br>> > reg_id=71&message=User Found in Database<br/><br>> ><br>> ><br>> ><br>> > 0<br>> ><br>> ><br>> ><br>> > Any ideas would be appreciated.<br>> ><br>> ><br>> ><br>> > Paul Swanson<br>> ><br>> > Internal Business Systems Analyst<br>> ><br>> > Internal Business Intelligence<br>> ><br>> > Harland Financial Solutions<br>> ><br>> > (800) 274-7280 Ext. 2462<br>> ><br>> > Paul.Swanson@harlandfs.com<br>> ><br>> ><br>> ><br>> ><br>> > This message and any attachment are intended solely for the addressee and<br>> > may contain confidential information. If you have received this message in<br>> > error, please send it back to me, and immediately delete it. Please do not<br>> > use, copy or disclose the information contained in this message or in any<br>> > attachment. Any views or opinions expressed by the author of this email do<br>> > not necessarily reflect the views of the University of Nottingham.<br>> > This message has been checked for viruses but the contents of an attachment<br>> > may still contain software viruses which could damage your computer system:<br>> > you are advised to perform your own checks. Email communications with the<br>> > University of Nottingham may be monitored as permitted by UK legislation.<br>> ><br>> > _______________________________________________ Xerte mailing list<br>> > Xerte@lists.nottingham.ac.uk<br>> > http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and any<br>> > attachment are intended solely for the addressee and may contain<br>> > confidential information. If you have received this message in error, please<br>> > send it back to me, and immediately delete it. Please do not use, copy or<br>> > disclose the information contained in this message or in any attachment. Any<br>> > views or opinions expressed by the author of this email do not necessarily<br>> > reflect the views of the University of Nottingham. This message has been<br>> > checked for viruses but the contents of an attachment may still contain<br>> > software viruses which could damage your computer system: you are advised to<br>> > perform your own checks. Email communications with the University of<br>> > Nottingham may be monitored as permitted by UK legislation.<br>> ><br>> ><br>> > _______________________________________________<br>> > Xerte mailing list<br>> > Xerte@lists.nottingham.ac.uk<br>> > http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> ><br>> > This message and any attachment are intended solely for the addressee and<br>> > may contain confidential information. If you have received this message in<br>> > error, please send it back to me, and immediately delete it.   Please do not<br>> > use, copy or disclose the information contained in this message or in any<br>> > attachment.  Any views or opinions expressed by the author of this email do<br>> > not necessarily reflect the views of the University of Nottingham.<br>> ><br>> > This message has been checked for viruses but the contents of an attachment<br>> > may still contain software viruses which could damage your computer system:<br>> > you are advised to perform your own checks. Email communications with the<br>> > University of Nottingham may be monitored as permitted by UK legislation.<br>> ><br>> ><br>> <br>> _______________________________________________<br>> Xerte mailing list<br>> Xerte@lists.nottingham.ac.uk<br>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br></div>                                           </div></body>
</html>