A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: members login authentication...

  1. #1
    Animal Flasher RobbieC's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    242

    members login authentication...

    Hi there, I've got a members area which uses php authentication connectiong to MySQL. Inside, I have a series of flash movies (AS2) which I need to protect in the same manner as the members area itself (to prevent direct linking to files).

    The php I am using for the site members area is as follows:

    PHP Code:
    <?php
        session_start
    ();
        require_once 
    'db_connection_info.php';
        
    $fd['email'] = $_SESSION['username'];
        
    $fd['pass'] = $_SESSION['password'];
        
    $q "SELECT * FROM users WHERE email = '" $fd['email'] . "' AND pass = '" $fd['password'] . "'";
        
    $user mysql_fetch_assoc(mysql_query($q));
        if(!
    $user) { header('Location: /home.php?badLogin=Y'); }
    ?>
    How can I integrate a similar script into my actionscript (AS2) so that only members can view these flash movies?

    Thanks in advance for pointing me in the right direction...

    Rob

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    there are two possible ways: one of them creates "garbage" links inside the member html area, and a valid user clicking on one of the links would get a redirect to the actual file. So if someone just copied the html part from a valid session, it would not help ... but the movies would still be cached by visitors.
    The other one replaces links to swf files by links to php files (note: if you are using adobe embedding wich takes the base name of your movie and adds .swf, you will need to fix that), and the php file is something like
    Code:
    <?
    $fp = fopen("movie.swf", "r");
    header("Cache-control: no-cache");
    header("Content-Type: application/x-shockwave-flash");
    fpassthru($fp);
    ?>
    Musicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center