-
Flash Login Form
I already have a php file and where the script should post the username and password, but how do I make the actual form? And how do you set it to post? Thanks to anybody that helps!
-Shane Reustle
Crath Networks Founder
-
FK'n_dog
how do I make the actual form
use Input text fields, set the password field to Password Mode ( will appear as ***** )
how do you set it to post
use loadVars.sendAndLoad -
this example sends a password (pwd.text) and category (cat.text) to the php file and the result is displayed in a dynamic text field (out1.text) Two buttons (btnA and btnB) are used to send the category- modify to suit your purposes
/* php file -
< ?php
$pass = "a12b";
$password = $_POST['pwd'];
$category = $_POST['cat'];
function control(){
global $category,$password,$pass;
if($pass == $password){
if($category == "catA") echo "&category=A was selected&";
elseif($category == "catB") echo "&category=B was selected&";
} else {
echo "&category=Enter correct password";
}
}
control();
?>
*/
// the Flash file -
PATH = "http://www.PATH TO YOUR/test.php";
//pwd.text = "a12b"; // for testing
function checker(){
send2Php = new LoadVars();
send2Php.pwd = pwd.text;
send2Php.cat = cat.text;
getFromPhp = new LoadVars();
getFromPhp.onLoad = function(){
trace(unescape(getFromPhp));
out1.text = getFromPhp.category;
};
send2Php.sendAndLoad(PATH,getFromPhp,"POST");
};
btnA.onRelease = function(){
cat.text = "catA"; checker(); };
btnb.onRelease = function(){
cat.text = "catB"; checker(); };
-
i currently have a login script already, http://www.crath.com/login.php?act=in and username is "username" and password is "password" to post the data. Would that make any kind of difference in your script? or can u have it post it right on there.
-
FK'n_dog
unable to reply as -
The requested URL /login.php was not found on this server
can you copy/paste the php and the instance names of your username and password input text fields ?
-
ok, i will reply again when it is back up. Were redoing some stuff. Now im just curious because im not using flash anymore, but could use on our demo templates.
-
If i could add on a question to this..
Im trying to do the same thing, but im at the point where i need to set up a php file (i have no idea what to do with that... or where to put it or anything) and then (since im kinda a newb) i need to know pretty much in baby terms how to get it to send whats put into some input text fields like a login.
-
It's a long way to the middle
Originally Posted by Dexi
If i could add on a question to this..
Im trying to do the same thing, but im at the point where i need to set up a php file (i have no idea what to do with that... or where to put it or anything) and then (since im kinda a newb) i need to know pretty much in baby terms how to get it to send whats put into some input text fields like a login.
Dexi, does this need to be a secure login? Or will everyone get the same password just to access a part of the site?
Do you need for people to register, or create a username and password?
-
well. its more of a registration process, not a login, i guess. the info they put it is sent to a storage file, then called upon later for acess.
-
It's a long way to the middle
Ok, well seaarch the movies section of this site for 'login'. You'll find a bunch of examples.
-
thanks
er. edit: Im not finding anything on how to get the info they put in to be sent to a storage file. Ive got creating the template and all the text fields and buttons. i just need to get the registration info, (User and pass) to be sent to a file, like on my computer, or a webpage or something (i heard about php on a site but i have no idea what to do) and then recalled when they try to log in.
Last edited by Dexi; 01-22-2006 at 03:15 PM.
-
FK'n_dog
check if php is installed on your server. paste this code to a text editor -
PHP Code:
<?php
phpinfo();
phpinfo(INFO_MODULES);
?>
and save it as phpinfo.php and upload it to the root folder of your server.
access it in your browser - http://yoursite/phpinfo.php
if php is installed, you will see something like --
System FreeBSD server29----
Build Date Nov 3 2005 14:10:22
Configure Command ----
if it not installed, check if your server supports cgi scripts ( a lot do )
there are lots of cgi scripts that will write info to a text file
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|