Flash and lPanel(cPanel) Login

  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 3+ Months Ago

Ok, I have a php user authentication script. I have an HTML form, that has the usual user and pass fields, uses the POST method to read the php script, and allows the user to login.

I want to use that same principle, only using a Flash 8 form. I made the username field, pass field, and submit button. I am not sure of the actionscript required to make it work though. Can anyone help me by posting a short tutorial, or the action script that would make this work? Thanks!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 3+ Months Ago

Thanks, but that's not quite going to work. See..the php file that reads the login is encrypted. I don't know any of the variables in it to add to the actionscript. All I have is the link to the php registration file.

See: http://webkore.net/

I know that login panel works, and you can login via that flash login. The HTML code of the page looks like:

Quote:
HTML Code for login to your members / affiliates / support / staff area:
<form name="form1" method="post" action="http://www.webkore.net/panel/userpassword.php">
<br>
<div align="center"> </div>
<table width="171" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td width="76"><div align="right"><font face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#000000"><strong><font color="#000000"><strong>Username</strong></font></strong></font></strong></font></div></td>
<td width="87"><div align="right"><strong><font color="#000000"><strong>
<input name="username" type="text" id="username" size="10" value="">
</strong></font></strong></div></td>
</tr>
<tr>
<td><div align="right"><font face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#000000"><strong>Password</strong></font></strong></font></div></td>
<td><div align="right"><strong>
<input name="password" type="password" id="password" size="10">
</strong></div></td>
</tr>
<tr>
<td height="26"><div align="right"></div></td>
<td><div align="right">
<input name="submit" type="submit" id="submit" value="Login">
</div></td>
</tr>
</table>
<div align="center"><br>
<a href="http://www.webkore.net/panel/lostpassword.php">lost password</a></div>
<p align="center">&nbsp; </p>
</form>>


Is there any way for me to recreate that except using flash instead? It has to be possible, because it's been done before....
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

sure, as u can see:
username and password are the name of the variables that must be passed;
so you`ll have:
lv.username = userInputText.text;
lv.password = passwordInputText.text;

and the rest is the same.
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 3+ Months Ago

Thanks IceCold, I appreciate it. So the final code looks like:

Code: [ Select ]
buttonName.onRelease = function() {
lv.username = userInputText.text;
lv.password = passwordInputText.text;

lv.sendAndLoad("http://www.webkore.net/panel/userpassword.php", "_blank", "_POST");
stop();
  1. buttonName.onRelease = function() {
  2. lv.username = userInputText.text;
  3. lv.password = passwordInputText.text;
  4. lv.sendAndLoad("http://www.webkore.net/panel/userpassword.php", "_blank", "_POST");
  5. stop();


Is that correct? if not, can you post the full code for me, and explain each line so I can grasp it. Forgive me, I can be very slow at time lol, and first thing in the morning is one of those times :P
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

Code: [ Select ]
var lv = new LoadVars(); // declare and initialise the LoadVars variable
buttonName.onRelease = function() {
lv.username = userInputText.text; // userInputText must be the instance of the input text box from the stage
lv.password = passwordInputText.text; // passwordInputText must be the instance of the input text box from the stage
lv.sendAndLoad("http://www.webkore.net/panel/userpassword.php", "_blank", "_POST"); // if you only send and dont wait for confirmation, use only lv.send(... same parameters..)
}
stop();
  1. var lv = new LoadVars(); // declare and initialise the LoadVars variable
  2. buttonName.onRelease = function() {
  3. lv.username = userInputText.text; // userInputText must be the instance of the input text box from the stage
  4. lv.password = passwordInputText.text; // passwordInputText must be the instance of the input text box from the stage
  5. lv.sendAndLoad("http://www.webkore.net/panel/userpassword.php", "_blank", "_POST"); // if you only send and dont wait for confirmation, use only lv.send(... same parameters..)
  6. }
  7. stop();

if you have troubles, let me know
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 3+ Months Ago

Hmmm...I placed in the code, and the button doesn't work. Is there anything I need to place on the button itself? My button has the instance name "submitButton".

The username txt box, password box, and submit button are all on one layer. I pasted the actionscript into the same layer, and there is no response from the button. So somehow...the button is not sending info..
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

instead of buttonName.onRealeas do submitButton.onRelease = function {
trace("calling"); .... rest of the code ... }
see if it traces "calling"
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 3+ Months Ago

HAHA! Ok my fault..I had put the actionscript on the wrong layer.

It's now on the right layer, the only problem now is...it pulls up the php page..and stops.

If you DON'T enter a user and pass, it works, goes to the page and announces wrong user and pass. But when you enter anything into the boxes, it just goes to the php page and sits there..rather then logging you in..

Any ideas?
  • SharkShark
  • Guru
  • Guru
  • User avatar
  • Posts: 1013
  • Loc: Living In Today

Post 3+ Months Ago

I got it working. Oddly enough, I made a hidden textfield, and named it submit, gave it a value of 1, and the login worked. Finished code is below. Thanks for the help.

Code: [ Select ]
var lv = new LoadVars(); // declare and initialise the LoadVars variable
buttonName.onRelease = function() {
lv.username = userInputText.text;
lv.password = passwordInputText.text;
lv.submit = submit.text; value = 1;
lv.send("http://www.yoursite.come/panel/userpassword.php", "_blank", "_POST");
}
stop();
  1. var lv = new LoadVars(); // declare and initialise the LoadVars variable
  2. buttonName.onRelease = function() {
  3. lv.username = userInputText.text;
  4. lv.password = passwordInputText.text;
  5. lv.submit = submit.text; value = 1;
  6. lv.send("http://www.yoursite.come/panel/userpassword.php", "_blank", "_POST");
  7. }
  8. stop();

Post Information

  • Total Posts in this topic: 10 posts
  • Users browsing this forum: No registered users and 10 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.