| Member List |
| Posted: 07 May 2007 09:01 | ||
|
Registered User Currently Offline |
Posts: 3 Join Date: May 2007 |
|
|
Since completing the tutorial as shown i have set up an apache server to act as my local host for testing purposes. I have also created the database called 'flex' with a table called users with fields: username, password and loginsuccess.
I have put sample data into the database. The database and login.php are sat on the server in the same location and my http service url is pointing at the server. When i run the app i get the following error: Error #1069: Property loginsuccess not found on String and there is no default value. any ideas...please help, i am a complete noob to all of this and trying to make sense of it all... |
||
| Posted: 08 May 2007 20:48 | ||
|
Administrator Currently Offline |
Posts: 156 Join Date: Oct 2006 |
|
|
Hi tom,
Welcome to Viper Creations
sorry for the late response! loginsuccess should not be a field in the table. it is what is output by the php script. for example, the php script should output either <loginsuccess>yes</loginsuccess> OR <loginsuccess>no</loginsuccess> yes or no depending whether or not the login was successful obviously. Here is the php code I used: Code:
1. <?php 2. define( "DATABASE_SERVER", "localhost" ); 3. define( "DATABASE_USERNAME", "user" ); 4. define( "DATABASE_PASSWORD", "pass" ); 5. define( "DATABASE_NAME", "flex" ); 6. //connect to the database 7. $mysql = mysql_connect(DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD) or die(mysql_error()); 8. //select the database 9. mysql_select_db( DATABASE_NAME ); 10. //asign the data passed from Flex to variables 11. $username = mysql_real_escape_string($_POST["username"]); 12. $password = mysql_real_escape_string($_POST["password"]); 13. //Query the database to see if the given username/password combination is valid. 14. $query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'"; 15. $result = mysql_fetch_array(mysql_query($query)); 16. //start outputting the XML 17. $output = "<loginsuccess>"; 18. //if the query returned true, the output <loginsuccess>yes</loginsuccess> else output <loginsuccess>no</loginsuccess> 19. if(!$result) 20. { 21. $output .= "no"; 22. }else{ 23. $output .= "yes"; 24. } 25. $output .= "</loginsuccess>"; 26. //output all the XML 27. print ($output); 28. ?> It's the same code as on the tutorial. Does that help you out? __________________ ![]() |
||
| Posted: 13 May 2007 10:43 | ||
|
Registered User Currently Offline |
Posts: 3 Join Date: May 2007 |
|
|
Hi Daniel thanks for you reply...it has helped my understanding of how to go about creating my own login flex app based on your tutorial. like i said i am a newbie to all this and have spent the last 12 months using flex but primarily interface design...it is only now that i would like to know how to retrieve and connect to a data source of some kind.
due to my familiarity (but very limited) knowledge of MS Access i decided that the design of a simple dbase in access would be the best way to go...i was going in blind lol...it was this initial belief that led me to your website initially i created a dbase called flex with the fields in it...(then corrected it by removing the loginsuccess field) installed apache... installed php... created a file called login.php and wacked them both on the server... i then pointed my http service to the localhost... thinking that magically the php and the access dbase would talk...(see i wasnt kidding my knowledge of this kind of stuff really is very bad!!) for the past week i have been reading around and have now discovered that i need to install mysql and the ODBC driver... having installed them both and hit more troubles trying to export a table in access using the ODBC driver... im still at a loss trying to see my way through this code like fog lol... any advice or help would be appreciated during these difficult times lol... thanks for all you help thus far. |
||
| Posted: 30 May 2007 02:58 | ||
|
Registered User Currently Offline |
Posts: 3 Join Date: May 2007 |
|
|
Hi Daniel, just to let you know i sorted it out and got it working |
||
| Posted: 30 May 2007 10:25 | ||
|
Administrator Currently Offline |
Posts: 156 Join Date: Oct 2006 |
|
|
Great!
Maybe you would like to tell us how you solved the problem? In case anybody else has that problem? __________________ ![]() |
||
| Posted: 09 Mar 2008 22:32 | ||
|
Registered User Currently Offline |
Posts: 1 Join Date: Mar 2008 |
|
|
ok, I hate to keep beating a dead horse, but I'm getting really frustrated.
I've followed the login system tutorial and everything is working great. I set up a DB that has the username and password stuff that the php file looks for, and when I change the url in the flex code to my url I get the error: [RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:216] at mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49] at mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103] at DirectHTTPMessageResponder/securityErrorHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:368] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/redirectEvent() Any help on this one will be very much appreciated. Thanks. |
||