Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 10:09 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Flex Pub-Post Web Data-Using ASP
PostPosted: April 10th, 2011, 1:15 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi,

Had posted for some help with post web data using ASP, thinking I couldn't use PHP. Updated my web site and got PHP functionality working. So, was able to set up the post web data using PHP with help from the excellent tutorials on the forum. The Flex Flash swf db connections work fine when running the SWF in a desktop standalone Flash 10 player. But when I upload the swf to my site, can't get it to insert/query. I wonder if the Flash/PHP/mysql connections on the server side are too slow?

So, I'm back to trying to figure out other solutions, using PHP and MS Access or MSSQL or same using ASP. Hopefully if I can figure out a script and test the swf when run on the server, it will connect and work.

Any suggestions appreciated.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 12th, 2011, 4:12 pm 
Offline
User avatar

Joined: October 25th, 2004, 10:33 am
Posts: 257
Location: UK
Opus: Pro 8
OS: Windows 7 Professional x64
System: Dell XPS15 i7x4 2.1Ghz 6GB 128GB SSD
Is the SWF hosted on the same server as the PHP? Otherwise Flash's security will not allow posting data.


For this message Dave Emberton has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 12th, 2011, 4:35 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Dave,

Yes, I'm using Robin's old tutorials (Part's I and II) and have created a sample Flex IMP precisely following the tutorials.

The 2 PHP files "insert.php" and "select.php" are both up on the same server as the uploaded SWF (I used one Flex SWF with 2 pages-one for inserting, one for selecting).

While they all communicate perfectly if I run the SWF on my desktop in the latest standalone Flash 10 player, they don't seem to communicate when all are on the same server.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 13th, 2011, 2:37 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
I seem to remember some issue with addresses when uploaded i.e. try simply 'insert.php' (or 'folder/insert.php' etc) rather than 'http://www...'. I think I set up 'if' statements so that it would use the full address when testing but local ones when uploaded. Also, I remember some limitation with working down folders (ie '../insert.php') although this may have been when playing with the html file. Sorry to be vague but I haven't got time to investigate this now. Perhaps just have a go.
Cheers
Dan

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


For this message dan1 has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 13th, 2011, 4:25 am 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Dan,

Yes! That worked! Thank you very much.

I was already placing these PHP files in the site's root, so no folders. But after removing the http://www......, and just leaving /insert.php, it worked. Tested in FF and IE.

Again, thank you.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 17th, 2011, 4:30 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi, again.

I also need to try to get data back from an MS SQL Server DB. While writing the PHP, using mssql functions instead of mysql functions, is fairly straightforward (they're about the same), making the connection with the SQL Server has been challenging. Have tried every combination, with and without a port number, etc. So far, nothing has worked. Cannot connect and get the data back into the Opus Flex using a SQL Server DB. (Doing this for MySQL works.)

The eLearning lesson LMS standard DB is SQL Server, not MySQL. And re-doing the LMS's data storage to MySQL has also failed.

So, if anyone has any tips, tricks, experience getting data back into Flex from a SQL Server DB, please help.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 17th, 2011, 5:00 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Don't have MSSQL server but this should work:

Code:
<?php
$myServer = "localhost";
$myUser = "your_name";
$myPass = "your_password";
$myDB = "examples";

//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
  or die("Couldn't connect to SQL Server on $myServer");

//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
  or die("Couldn't open database $myDB");

//close the connection
mssql_close($dbhandle);
?>


PHP Manual is a good place to start: http://www.php.net/manual/en/ref.mssql.php

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 17th, 2011, 6:03 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Mack,

Thanks for these suggestions. Unfortunately, I've used precisely the PHP script suggested (and read the PHP manual's relevant sections). And, I agree, it should work. The SQL Server DB is up and running (it it used by the LMS regularly, and works OK). But for whatever reason, the PHP configuration to connect doesn't seem to connect. I believe that the problem is connecting. I've also checked all the permissions, etc.

The LMS connects via a pre-cofigured ASP template that uses a connection string (works every time):

connectionstring="Provider=sqloledb; Data Source=xyz.db.11111.abc.com; Initial Catalog=name1; User ID=name1; Password=zzzzz;"

So, I tried another strategy: trying to write an ASP script to access the DB and return data back to the Flex SWF.

So, far, using a connection test ASP script, and the above connectionstring (http://kb.deru.net/?View=entry&EntryID=53), I have been able to get a correct data item back from the SQL Server DB that displays on the ASP page which I've uploaded to my site. So, the ASP connection and accessing of data works.

But, trying to get the data back into the Flex SWF using the post web data (destination) action, so far does not work. So, the ASP script which uses response.write.recordset is not sending back the data into the SWF.

Not sure how to script this in ASP to get the data back.

Challenging issue!

Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 17th, 2011, 8:48 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Is MSSQL enabled in the PHP settings?

Create a script that checks phpinfo() and look for the MSSQL section. If it's not there, then see if you host will change it for you.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 17th, 2011, 9:29 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi mack,

Yes, I uploaded a new phpinfo.php, and it has a section for mssql. So, I think PHP 5.2.17 is enabled.

So, a little dilemma. I can connect with the SQL Server DB using a test ASP script, but cannot get anything back into the Flex SWF. Or, I can write a capable PHP script that is likely going to work in the Flex SWF (same script but written for mysql instead of mssql gets back data into the Flex SWF), but will not connect with the SQL Server DB.

What to do?

Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 18th, 2011, 11:06 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Morning Stephen,

If I were a gambling man, I go the PHP route.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 18th, 2011, 12:11 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Mack,

Yes, I would use the PHP route, since Opus Flex works well with it, if only I could connect to the SQL Server DB (where the LMS likes to store its data).

An ASP test script using the following connect string, connects to the SQL Server DB:

Code:
connectionstring="Provider=sqloledb; Data Source=xyz.db.11111.abc.com; Initial Catalog=name1; User ID=name1; Password=zzzzz;"

I wish there was a way to "translate" this ASP-formatted connection string into PHP to facilitate connecting. (PHP connect function parameters don't seem to allow for replicating this connection string data in a way that successfully connects.)

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 18th, 2011, 2:20 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Have you tried running the PHP script from your host to see what the error message is?

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 18th, 2011, 2:42 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Mack,

Using a similar PHP script to the one you posted above, I got the following errors:

Quote:
Warning: mssql_query() [function.mssql-query]: message: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (severity 16) in D:\Hosting\xxxxxxx\html\select5.php on line 11

Warning: mssql_query() [function.mssql-query]: Query failed in D:\Hosting\xxxxxxx\html\select5.php on line 11

Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in D:\Hosting\xxxxxxx\html\select5.php on line 13
&KPUser=&KPPassword=


Not too sure what they mean.

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Flex Pub-Post Web Data-Using ASP
PostPosted: April 18th, 2011, 3:15 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Google is a friend.

http://www.phpbuilder.com/board/showthr ... t=10345581

I would also ensure that you are testing in small bits. IE just having a logon script to check that you can at least connect to the database. Keep it simple and build up.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group