473,796 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Flash not reading the PHP files

6 New Member
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 1292
pbmods
5,821 Recognized Expert Expert
Heya, J.

What error message do you get from lvReceive.onLoa d (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
13476
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 difficulty reading back into Flash local variables. Say, for instance, I have a Flash page that has a number of typein fields. Each of the typeins has a variable associated with it.
42
4973
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> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head>
3
3070
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
1983
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 get an error in Flash when it trys to open this file using standard Flash commands. However when I change the file name and command to 'Web.xml' it works. (it also works if I don't change the name, but run the swf in flash player and not via the...
2
3552
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 in a page. The first 1 (a simple link to an existing swf-file on the webserver) is showing in each browser (IE & FF), while the other one (using the filedownload page) is only being shown in FF. Does it have something to do with file-extension?
3
2039
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 content-type in the headers whether I'm delivering html/css/jpeg/etc. The second is reading those simple html/css files as opposed to having the html hard coded. My problem occurs when trying to display flash files. I am also only able to...
0
2046
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
1794
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 move the entire Flash Workings from this site into another webpage, where it would act as a simple Flash Movie. To achieve this, I : used Flash Capture programms - they failed and resulted in a loop of the loading bar screen Searched through...
0
3257
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 server. code is as follows. this is flash object: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550"...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10456
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10012
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7548
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.