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 8 of 8
  1. #1
    Regular Coder
    Join Date
    Feb 2006
    Posts
    149
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do you make different file type load in different script?

    First hello

    How do I make it so if a file ends in .nes it uses this:


    rmoeved


    Thanks in advance
    Last edited by Al Capone; 02-13-2006 at 03:21 AM.

  • #2
    New Coder
    Join Date
    Jan 2006
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    .swf files won't be able to use those HTML tags. I don't know for .nes files.
    What do you mean with your question?

  • #3
    Regular Coder
    Join Date
    Feb 2006
    Posts
    149
    Thanks
    0
    Thanked 0 Times in 0 Posts
    first off thanks for the reply.

    Both codes work, they retrieve the files from mySQL, but thats not the thing, .nes wont work in the one loading .swf and .swf wont open in the .nes script.

    I want it to use the top script when a file is .nes

    and i want it to use the bottom script when the file is .swf

    i hope that wasnt confusing. i want it to use the top one when the file ends in .nes and bottom one when it ends in .swf

    thanks in advance for any help.

  • #4
    New Coder
    Join Date
    Jan 2006
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh, I think I get it now. You'll have something like page.php?file=something.nes or page.php?file=something.swf?

    You could try something like this:
    PHP Code:
    if (strstr($file".swf")) {
    //.SWF code here
    } else if (strstr($file".nes")) {
    //.NES code here

    Hope that helps

  • #5
    Regular Coder
    Join Date
    Feb 2006
    Posts
    149
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, but it didn't work, I am using this right now:


    <tr>
    <td><div align="center"><br>
    <center>

    if (strstr($file, ".swf")) {
    <param name="movie" value="swf/';
    echo $row['file'];
    echo '" />
    <param name="quality" value="high" />
    <embed src="swf/';
    echo $row['file'];
    echo '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="';
    echo $defaultwidth;
    echo '" height="';
    echo $defaultheight;
    echo '"></embed> </TD> </TR>

    </TABLE>

    </P>
    </center>
    } else if (strstr($file, ".nes")) {
    <applet code=NESCafeApplet



    archive="nescafe.jar"
    codebase="."
    ROMFILE="/swf/';
    echo $row['file'];
    echo '"
    width=390
    height=366
    name=nescafe>

    <param name=LOADDATAURL value="nescafeload.php"
    <param name=SAVEDATAURL value="nescafesave.php?user=user">
    <param name=SOUND value="false">
    <param name=LIGHTGUN value="false">
    </applet><P align=center>

    <TABLE cellspacing=0 cellpadding=0>

    <TR>
    <TD width=100 colspan=2><FONT face=Tahoma size=1 color=#000000><B>CONTROLS</B></font></TD>
    </TR>

    <TR>
    <TD width=100><FONT face=Tahoma size=1 color=#000000>Start Button</font></TD>
    <TD align=right><FONT face=Tahoma size=1 color=#000000>ENTER</font></TD>
    </TR>

    <TR>
    <TD><FONT face=Tahoma size=1 color=#000000>Select Button</font></TD>
    <TD align=RIGHT><FONT face=Tahoma size=1 color=#000000>SPACE</font></TD>
    </TR>

    <TR>
    <TD><FONT face=Tahoma size=1 color=#000000>A Button</font></TD>
    <TD align=RIGHT><FONT face=Tahoma size=1 color=#000000>X</font></TD>
    </TR>

    <TR>
    <TD><FONT face=Tahoma size=1 color=#000000>B Button</font></TD>
    <TD align=RIGHT><FONT face=Tahoma size=1 color=#000000>Z</font></TD>
    </TR>

    <TR>
    <TD><FONT face=Tahoma size=1 color=#000000>Pause NESCafe</font></TD>
    <TD align=RIGHT><FONT face=Tahoma size=1 color=#000000>P</font></TD>
    </TR>

    <TR>
    <TD><FONT face=Tahoma size=1 color=#000000>Toggle Sound</font></TD>
    <TD align=RIGHT><FONT face=Tahoma size=1 color=#000000>S</font></TD>
    </TR>

    </TABLE>

    </P>
    </center> }

    But for some reason it comes out looking like this

    it just looks like text for some reason


    Could someone tell me whats wrong with what I am using? Thanks in advance.
    Last edited by Al Capone; 02-12-2006 at 07:59 PM.

  • #6
    New Coder
    Join Date
    Jan 2006
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No problem ^_^

  • #7
    Regular Coder
    Join Date
    Feb 2006
    Posts
    149
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I see two windows and text for some reason when I did it (please see my attached screen shot below or the link above in previous post) I thought it worked because I didn't refresh, the code in my preious post is the portion that i think the problem is, if it's nessessary i can post the whole script i am using

    I don't know what's wrong, please help, thanks in advance
    Attached Thumbnails Attached Thumbnails How do you make different file type load in different script?-problem.jpg  

  • #8
    New Coder
    Join Date
    Jan 2006
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    YOu need to add PHP tags:
    <?php
    and
    ?>
    in the right places. I'm sorry I can't help you more, I've got to go now. If you still haven't got it figured out yet, I'll help you tomorrow. Good luck!


  •  

    Posting Permissions

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