Viper Creations
Comeback Contest
Check out our forums for the an explosive comeback contest. We are giving away everything from iPods to Visual Studio. more...
»User: »Password:   Remember Me? 
Posted:  11 Feb 2007 05:02
Hello.. Is it possible that you could make that tutorial a little more understandable for newbies? I just got the program, so I basically don't know anything. I mean like, where to put in the scripts.. I would just love that! Thanks in advance.
__________________
I'm dreaming in pixels
Posted:  11 Feb 2007 18:57
welcome to viper creations!

let me know what you're having trouble with and i'll be more than happy to help you!
__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  12 Feb 2007 01:28
Currently, I'm having trouble with connecting to my login system.. It worked with your vipercreation/login.php, but I can't manage to get mine  working..
__________________
I'm dreaming in pixels
Posted:  12 Feb 2007 15:49
ok. do you have apache installed on your machine?

you need apache installed with php to make it work.

If you install vertrigoserv, http://vertrigo.sourceforge.net/
you would be able to use the login script locally as it comes bundled with mysql and php.
__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  12 Feb 2007 16:45
Yes, I do.. But I don't know where to pu the scripts and how to configure them..
__________________
I'm dreaming in pixels
Posted:  13 Feb 2007 15:42
put the scripts in your www directory of your server.

what don't you know how to configure?
__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  14 Feb 2007 14:16
Yea, I put them in htdocs/flex, but I don't know what it should be called, like database.php or .sql or yea..
__________________
I'm dreaming in pixels
Posted:  14 Feb 2007 16:29
you can name it whatever you want. i named my script login.php in the tutorial because it does the job of logging you in
__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  15 Feb 2007 06:42
Hehe, alright.. But I'm pretty new and slow when it comes to scripting and all that, so you wouldn't mind posting the scripts?
__________________
I'm dreaming in pixels
Posted:  15 Feb 2007 15:36   Last Edited By: danielneri
The php script i used is on the tutorial -
http://www.vipercreations.com/tutorials/Adobe%20Flex/28.html

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.
      ?>

__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  16 Feb 2007 11:50
Meh, not working.. I'll just skip Flex ;(
Thanks for the help though
__________________
I'm dreaming in pixels
Posted:  16 Feb 2007 20:45
Well flex is a wonderful program and i would say it's definitely worth pursuing.

Do you have aim or msn or something?

I really would like to help you out.
__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  19 Feb 2007 03:04
Yes, I do
Mitchell91a@hotmail.com

Thanks for trying to help me out
__________________
I'm dreaming in pixels
Posted:  22 Feb 2007 09:07
I know its totally off topic, but I got your answer in yahoo answers and would like to offer you a heartly thankyou.

I've been having mega trouble getting to grips with how flex works and I think this might give me uber-help. I'm currently doing my final year project at uni, which uses php, sql, rss/xml and flex.

Thanks!
Posted:  22 Feb 2007 19:46
No problem!

oh and you're welcome to stick around for PLENTY more flex tutorials
__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  17 Mar 2007 00:17
hi everyone. i have the member area working and everything but i try to add a file uploader to the members area and it says error #1009. can someone please help me. ive tried everything
Posted:  17 Mar 2007 10:38
Could you explain the error in detail?

What is the exact error it gives you?
__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  17 Mar 2007 20:53
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at index/:nSelectFile()


go to http://www.dymemag.net/members/  the username and password are both test
Posted:  19 Mar 2007 12:53
What files are you accepting? Can you post your code? I can't upload anything so I cant determine what's wrong.
Posted:  19 Mar 2007 16:01
i wanna accept any filetype. the source files are at http://www.dymemag.net/members/source/
the php files were renamed to .txt so u can view the coding. and i removed the database info for security reasons.
Posted:  23 Mar 2007 18:13
For some odd reason nothing seems to be happening when you select a file!
__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  24 Mar 2007 10:28
well can u fix it for me? take the code and rebuild it
Posted:  01 Apr 2007 22:23
Once again, great Flex - Login tutorial. Was wondering if you could do a tutorial on expiring a Flex project using php and mysql. When I create drafts for clients, I would like to have a way to set an expiration date for the file either within the application (expiration date) or when they login. It would be really great if I could also implement the solution into an Apollo air file so the client could just download the .air file, look over the draft(s), and they'd expire.
Posted:  03 Apr 2007 12:51
ok, i'm a real beginner at flex, never used it b4. Would someone be kind enough to explain to me all these things you are talking about and help me through your tutorial because i'm getting it wrong...
THANKS!!!
Rowan
Posted:  05 Apr 2007 18:20
marty - It shouldn't be too difficult.

What you could do is add a function, say initApp() and call it when your application is created - creationComplete=""

Then generate the current date and check it against the date you want it to expire, and if it is expired, just spit out an alert box and when the user clicks ok just kill the app.

That's the way I'd do it. I know I'm being quite vague - so if you need more help drop me a line using the contact form on this site

rowan - same deal, just fire over an email and I'll get back to you
__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  10 Apr 2007 05:44
your tutorial is nice,i have executed ur login system.It works fine in my system.

i'm new to flex,i would like to know more in login system.

I'm developing an application using flex and php that requires login system,if the user has logged in with valid username and password it should navigate to another mxml file.

           (Ex:combo.mxml)
In ur tutorial,u have just shown wat happens when the user logged in.


How to do this explain me?
Posted:  11 Apr 2007 18:49
Hmm, to tell the truth bala im not exactly sure!

But here is a quick and dirty way to do it:

In your php script, set a cookie if the login is successful.

Then use navigateToURL() in flex to navigate to the other .swf file.

In that file, just setup an httprequest to a php file that checks if there is a cookie set or not in case someone tries to get in without logging in
__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  27 May 2007 09:00
I use your login system, with mysql database, but i don;t now what for tabel structure you use in your database... can you tell me?
Posted:  28 May 2007 19:16
Hi Phii,

just three fields, id, username, and password

Simple stuff.
__________________
http://www.vipercreations.com/images/banner/result.gif
Posted:  29 May 2007 12:07
Guys, this post has now been locked because people are posting their problems in other peoples threads.

Please create your own thread if you are having problems!

Thanks
__________________
http://www.vipercreations.com/images/banner/result.gif