PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
PHP to swf problem
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: PHP to swf problem

  1. #1
    Games don't die...people do!
    Join Date
    Jan 2002
    Posts
    58

    PHP to swf problem

    I'm using flash 8

    I have a php page that sends the session to this page (below)

    PHP page name: _flash.php
    Code inside the php page:

    Actionscript Code:
    <?
    session_start();
    echo "&stud=".$_SESSION['Id'];
    header("Cache-Control: &stud=".$_SESSION['Id']);
    header("location: http://localhost/pages/test.swf");
    ?>

    Inside my .fla

    Actionscript Code:
    myData = new LoadVars()
       
         myData.load("_flash.php")
       
        myData.onLoad = function(success){
          if(success){

          stud_Id.text = this.stud
     
          } else trace ("Error loading data")
         
        }

    I have a dynamic text box that should display the stud_Id but it's not working! Can anyone tell me what is wrong with the PHP code? When I input this
    Actionscript Code:
    <?

    $fakeID='2000';

    echo "&stud=".$fakeID;


    ?>
    into the PHP code it works so I know it's not the flash. If I comment out the Header part I see the var on the webpage...
    Last edited by DW Stanford; 10-15-2010 at 09:33 PM.
    dws

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

    to start with: do you have another php page that establishes session content?
    You could use live http headers extension in firefox to verify an entire session

    Musicman

  3. #3
    Senior Member
    Join Date
    May 2010
    Posts
    178
    PHP Code:
    <?PHP
    session_start
    ();
    $id=session_id();
    echo 
    "&stud=$id";
    ?>
    PHP Code:
    <?PHP
    session_start
    ();
    $_SESSION['fakeID'] =45;
    $_SESSION['test'] =session_id();
    echo 
    "&stud=".$_SESSION['test'];
    ?>
    Poltuda
    Last edited by poltuda; 10-18-2010 at 04:27 AM.

  4. #4
    Games don't die...people do!
    Join Date
    Jan 2002
    Posts
    58
    Musicman - Thank you for the reply. Yes, the session content comes from another php page and it will show on this page but for some reason when I add the Header redirect header("location: http://localhost/pages/test.swf");the var is gone! So, the session is working.

    Poltuda- Thanks again! But I don't understand what you are doing here with the two php examples?
    dws

  5. #5
    Senior Member
    Join Date
    May 2010
    Posts
    178

    Sorry if I'm Wrong

    But the thing what I understood is, you want to load an ID from a php page into flash, is it correct?
    The php page load the swf with the ID inside, right?




    Breath

    _flash.php

    PHP Code:
    <?PHP
    session_start
    ();
    $_SESSION['Id']=session_id();
    header("Cache-Control: &stud=".$_SESSION['Id']);
    header("location: http://localhost/pages/test.swf");
    ?>
    _flash_1.php

    PHP Code:
    <?PHP
    session_start
    ();
    echo 
    "&stud=".$_SESSION['Id'];
    ?>

    Actionscript Code:
    myData = new LoadVars();
    myData.onLoad = function(success:Boolean) {
        if (success) {
            stud_Id.text =this.stud;
        } else {
            trace("Error loading data");
        }
    };
    myData.load("http://localhost/_flash_1.php");


    Sorry if I'm Wrong again......

    Poltuda

  6. #6
    Games don't die...people do!
    Join Date
    Jan 2002
    Posts
    58
    Quote Originally Posted by poltuda View Post
    But the thing what I understood is, you want to load an ID from a php page into flash, is it correct?
    The php page load the swf with the ID inside, right?

    _flash_1.php

    PHP Code:
    <?PHP
    session_start
    ();
    echo 
    "&stud=".$_SESSION['Id'];
    ?>


    Poltuda
    Yes you are correct except...Sorry...I left out that the swf file is "NOT" loading into any webpage (html or php)...it's just a swf file. If I test your code the "echo" is showing on the php page with the swf (id printing on webpage). Is there a way so that the echo statement won't show?
    dws

  7. #7
    Senior Member
    Join Date
    May 2010
    Posts
    178

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