473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Flash not reading the PHP files

I have been trying to create an authentication system using PHP5+, MYSQL 5+ and APACHE2+ using Actionscript3. When I got the codes together my password and usernames would not check against the MYSQL database, so I tried changing the code to then just obtain the passwords straight from the PHP files. I was just trying something different as I had been tearing my hair out over this and to my surprise even this did not work. I am new to this so I might need some correcting, but I did not see any errors in this. Can you guys help me.
Also when I directly write php code to insert data into the MySQL database but when I run that code through actionscript it fails to work.

Thanks in advanced.

Here is my php codes:

---------logincheck------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3. $username = $_POST['username'];
  4. $password = $_POST['password'];
  5.  
  6. //in real life you will probably want to check whether the username/password exist in a database instead
  7. if($username == "admin" && $password == "password"){
  8. $_SESSION['loggedIn'] = true;
  9. echo 'login=success';
  10. }else{
  11. echo 'login=failure';
  12. }
  13. ?>
  14.  
-------------------------members php-------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3. //check if the loggedIn session has been really set so that noone can access this page directly. If it is not set send him to login page
  4. if(!isset($_SESSION['loggedIn'])){
  5. header("Location: login.html");
  6. exit();
  7.  
  8. }
  9. ?><style type="text/css">
  10. <!--
  11. body {
  12.     background-color: #333333;
  13. }
  14. .style1 {
  15.     color: #FFFFCC;
  16.     font-weight: bold;
  17. }
  18. -->
  19. </style>
  20. <span class="style1">
  21. Congratulations you are now in the upload area</span>
  22.  
-----------------------------------and finally the actionscript code just in case:--------------------------------------
Expand|Select|Wrap|Line Numbers
  1. tError.autoSize = "right";
  2.  
  3. var lvSend:LoadVars = new LoadVars();
  4. var lvReceive:LoadVars = new LoadVars();
  5.  
  6. mcLogin.onRelease = function() {
  7.     lvSend.username = tUsername.text;
  8.     lvSend.password = tPassword.text;
  9.     lvSend.sendAndLoad("logincheck.php", lvReceive, "POST");
  10. };
  11.  
  12. lvReceive.onLoad = function(success:Boolean) {
  13.     if (success) {
  14.         if (this.login == "success") {
  15.             getURL("members.php");
  16.         }else{
  17.         tError.text = "I'm sorry you did not enter valid login details";
  18.         }
  19.     } else {
  20.         trace("no reponse from server");
  21.     }
  22. };
Dec 26 '07 #1
1 1261
pbmods
5,821 Expert 4TB
Heya, J.

What error message do you get from lvReceive.onLoad (no response or invalid info)?
Jan 2 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ralph Seguin | last post by:
Ok... I am having problems getting variables/values INTO Flash from an external source (PHP). I'm NOT having problems getting loadVariablesNum() to _SEND_ variables via POST, but I _AM_ having...
42
by: Manu | last post by:
How can i do with a flash object for obtain the w3c label ? the "embed" is not accepted ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>test</title>...
3
by: sureshsundar007 | last post by:
Hi all, I want to know how to read the Flash file (.SWF) information using C#. Any help is greatly appreciated. Thanks, Suresh.
5
by: JJ | last post by:
Although this question involves Flash, I suspect the actual issue is an asp one.. I am trying to open the web.sitemap file in an .swf file enbedded in an asp page (I'm working in VS 2005). I...
2
by: avanhalen | last post by:
To embed flash objects in my pages, I read them from a database. A script file (Filedownload.aspx) reads it from the database, and streams it to the browser. Here are two example flash objects...
3
by: earl.bobby | last post by:
I'm creating a webserver to run from a CD. I've found http://www.adp-gmbh.ch/win/misc/webserver.html which is my starting block. I've really made two modifications. First adding the appropriate...
0
by: fblake | last post by:
Active Flash V1.0 http://www.activeup.com/products/components/activeflash Price - $295 Evaluation - http://dl.filekicker.com/send/file/184524-5045/ActiveFlash1.zip
1
by: akir | last post by:
Before I begin, I would like to highlight that I'm a fairly novice Flash User. I've recently used the website building tool many of you may of heard of called Cabanova. I decided that I wanted to...
0
by: Shaikh shahnawaz | last post by:
Hi, I have implement multiple file uploading progress bar with the help of flash and .net file is upload on my local machine but not working with server it's give error while uploading image on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.