Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    478
    Thanks
    3
    Thanked 0 Times in 0 Posts

    problems setting a variable in XML

    i have an XML file which is used by a FLA flash movie.

    i have changed the extention to PHP to allow me to get the info for the XML from mysql database.

    but need to setup a variable with a username of the info i want to get, prior to the database being checked.

    so i have one php file like so...

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>


    Code:
    <body>
    <? $owner = "Daniel"; ?>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="670" height="670">
      <param name="movie" value="photoalbum_show_imagesV2a.swf">
      <param name=quality value=high>
      <embed src="photoalbum_show_imagesV2a.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="670" height="670"></embed> 
    </object>
    </body>
    </html>
    the SWF file is a flash slideshow which gets the image details using the XML file... which i have renamed to be a PHP file.



    get_image_names.php
    Code:
    <?php echo('<?xml version="1.0" encoding="utf-8" standalone="yes"?>'); ?>
    <?php
    include("dbconfigfile.php");
    $xmls = @mysql_query("SELECT * FROM `photo_album_xmls` WHERE `owner` = '" . $owner . "'") or die(mysql_error());
    ?>
    
    <images>
    <?php
    while($rows=@mysql_fetch_array($xmls)){
    ?>
        <pic>
            <image>http://www.domain.com/<?php echo($rows[url]);?></image>
            <caption><?php echo($rows[desc]);?></caption>
        </pic>
    <?php
    }
    ?>
    </images>
    but the variable 'owner' is the username and this for some reason does not get seen by the SWF file.

    how do i embed this info into the <object> part so that the SWF file will use it to get the info need from the database.

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    Quote Originally Posted by jasonc310771 View Post
    how do i embed this info into the <object> part so that the SWF file will use it to get the info need from the database.
    use the complete url to the php script instead of the relative path of the php file
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by jasonc310771 View Post
    i have an XML file which is used by a FLA flash movie.

    i have changed the extention to PHP to allow me to get the info for the XML from mysql database.

    but need to setup a variable with a username of the info i want to get, prior to the database being checked.

    so i have one php file like so...

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>


    Code:
    <body>
    <? $owner = "Daniel"; ?>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="670" height="670">
      <param name="movie" value="photoalbum_show_imagesV2a.swf">
      <param name=quality value=high>
      <embed src="photoalbum_show_imagesV2a.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="670" height="670"></embed> 
    </object>
    </body>
    </html>
    the SWF file is a flash slideshow which gets the image details using the XML file... which i have renamed to be a PHP file.



    get_image_names.php
    Code:
    <?php echo('<?xml version="1.0" encoding="utf-8" standalone="yes"?>'); ?>
    <?php
    include("dbconfigfile.php");
    $xmls = @mysql_query("SELECT * FROM `photo_album_xmls` WHERE `owner` = '" . $owner . "'") or die(mysql_error());
    ?>
    
    <images>
    <?php
    while($rows=@mysql_fetch_array($xmls)){
    ?>
        <pic>
            <image>http://www.domain.com/<?php echo($rows[url]);?></image>
            <caption><?php echo($rows[desc]);?></caption>
        </pic>
    <?php
    }
    ?>
    </images>
    but the variable 'owner' is the username and this for some reason does not get seen by the SWF file.

    how do i embed this info into the <object> part so that the SWF file will use it to get the info need from the database.
    this could be a flash or php question but not xml. ask one of the moderators to move your thread in one of this forums if you want an answer.

    regards

  • #4
    Regular Coder
    Join Date
    Mar 2006
    Posts
    478
    Thanks
    3
    Thanked 0 Times in 0 Posts
    how do i request that this post be moved?

  • #5
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by jasonc310771 View Post
    how do i request that this post be moved?
    good question, I never really know but I suppose you can PM one of them. See the user profile of one of the moderators from the bottom page of the forum.

    best regards

  • #6
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    I can move it, just tell me which forum you prefer.

    (I generally read all traffic in this forum.)
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #7
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by Alex Vincent View Post
    I can move it, just tell me which forum you prefer.

    (I generally read all traffic in this forum.)
    I guess in flash forum:

    but the variable 'owner' is the username and this for some reason does not get seen by the SWF file.
    don't seems to be a php problem, but I'm not sure.

    best regards


  •  

    Posting Permissions

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