Solved

how to create flex login system using PHP as the backend

Posted on 2011-03-04
7
1,442 Views
Last Modified: 2012-05-11
Hi,
I am using flash builder 4 and would like to create a login system using flash builder 4 as the front end and php as the back end.  i found a tutorial that i found on the website but getting this error when i try to run it:
 "'HTTPService' declaration must be contained within the <Declarations> tag since it does not implement 'mx.core.IUIComponent'.      Login.mxml      /Login/src      line 27      Flex Problem"

However, i am not sure where i saved the php file is wrong or not as you see i saved the php file under this root ="C:\wamp\www\mylogin.php"
Pls help thanks
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
	<fx:Script>
		<![CDATA[
			import mx.rpc.events.ResultEvent;
			import mx.controls.Alert;
			
		       private function login():void
			   {  
			       loginservice.send();
			   }
			private function onResult(e:ResultEvent):void
			{
				if (e.result.status == true)
				{
					Alert.show("Signed in successfully", "Success");
				}
				else
				{
					Alert.show("No soup for you", "Failure");
				}
			}
		]]>
	</fx:Script>
	<mx:HTTPService id="loginservice" url="C:\wamp\www\mylogin.php" showBusyCursor="true" method="post" result="onResult(event)">
    <mx:request xmlns="">
	<user>{txtUser.text}</user>
	<pass>{txtPass.text}</pass>
		
		
	</mx:request>
	</mx:HTTPService>
					
	<s:Panel x="37" y="33" width="468" height="294" title="Login">
		<s:Label x="34" y="51" text="Username"/>
		<s:Label x="34" y="85" text="Password"/>
		<s:TextInput x="98" y="46" id="txtUser"/>
		<s:TextInput x="98" y="76" id="txtPass"/>
		<s:Button x="156" y="117" label="Login" id="loginID" click="login()"/>
	</s:Panel>
</s:Application>

Open in new window

0
Comment
Question by:karinos57
  • 3
  • 2
7 Comments
 
LVL 19

Accepted Solution

by:
quizengine earned 250 total points
ID: 35043162
I'm not able to pass comment on your code, but I can suggest alternate ways of logging in using flex - try here - http://activeden.net/searches?term=login&type=files&categories=flex&sidebar_redirect=true
0
 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 35046618
I cannot help with the Adobe Flex or Flash part, but I can show you the principles of a simple PHP authentication system.  I have an article here at EE that teaches the basics.  Please read it over and post back with any questions.  The only differences would be to replace the HTML forms with your Adobe equivalents.

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_2391-PHP-login-logout-and-easy-access-control.html

Best of luck with your project, ~Ray
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 35085934
@karinos57: The grade of "C" is the worst possible grade you can give at EE.  I really meant it when I said, "Please read it over and post back with any questions."  But instead of posting back with questions, you wrote, "i am not gonna get the solution" and gave a bad grade.  How can we help you if we can't  have any dialog?

The activeden.net links looked pretty good to me.
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

by:karinos57
ID: 35088793
i did not mean just to give u bad grades but there was no solution for almost 2 weaks and i thought you guys were only experts on php and not flex so i have decided to close it.  i have to buy the code from the activeden.net  and i thought they were going to show me how to do it but it is not free.  thanks anyway for all your efforts.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 35090388
"Not free" is kind of relative, right?  If a script costs $100 and I can buy it or spend a day of my life writing the "new wheel" version of it, I am not going to write new code when I could buy it.  For me that would be the path of least cost and least resistance. The expression, "time is money" means to say that these are fungible commodities.  

Anyway, best of luck with the project. ~Ray
0
 

Author Closing Comment

by:karinos57
ID: 35096614
thanks guys for the help
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question