Jump to content

[SOLVED] Dropdown Menu + if vars


Graxeon

Recommended Posts

First off, hello! ;D

 

Alrighty then:

 

I'm a complete newbie at PHP. I was messing around with my videos and I wanted to organize them a bit for online use.

 

So here is what I'd like to do:

 

I have FLV videos playing through a flash player whos name I can't give out apparently because of the advertising rule....but I'll give the code for it later on.

 

Now, I can get those FLV videos working all nice and dandy but I have to create multiple pages for each video since I was just using HTML. However, with PHP I can, of course, make it a bit easier.

 

I'd like this set-up:

 

<html>
    <head>
        <title></title>
    </head>
    <body>
        <h4>Title</h4>
        <form action="process.php" method="post">
            <select name="videos">
            <option selected="selected">Select a playlist</option>
            <option>Playlist1</option>
            <option>Playlist2</option>
            <option>Playlist3</option>
            </select> Video #: <input name="episode" type="text" /> <input type="submit" value="Submit Query" />
        </form>
    </body>
</html>

 

Now with that...I'd like to make it compatible with this flash player:

 

 

<script type="text/javascript" src="swfobject.js"></script> <div id="player">PlaylistX - episodeX</div> <script type="text/javascript">var so = new SWFObject('mediaplayer.swf','mpl','480','272','8');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('height','272');
so.addVariable('width','480');
so.addVariable('file','playlistXepisodeX.flv');
so.addVariable('logo','WATERMARK.png');
so.addVariable('searchbar','false');
so.addVariable('showstop','true');
so.write('player');
</script>

 

So in the end, I'd like a PHP file which takes that form's (first code I gave) inputs and have it output that flash player code but with the specified video implemented.

 

I don't mind using the entire flash player code per video, I'd rather have a huge file than a million of them :P

 

I tried using the IF and ARRY things but with not much of an outcome. I thought that if I said something like "if videos = Playlist1 and episode = 1 then final output that the user would see is this:

 

<script type="text/javascript" src="swfobject.js"></script> <div id="player">Playlist1 - episode1</div> <script type="text/javascript">var so = new SWFObject('mediaplayer.swf','mpl','480','272','8');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('height','272');
so.addVariable('width','480');
so.addVariable('file','playlist1episode1.flv');
so.addVariable('logo','WATERMARK.png');
so.addVariable('searchbar','false');
so.addVariable('showstop','true');
so.write('player');
</script>

 

So umm...can someone help me with this? Idk what this would be called so idk what to search for :-[.

Link to comment
Share on other sites

first of all start reading the PHP manual.

GOOGLE it and read it all.

It should help but any more errors come back here

 

Well...my main problem is finding out what this is even called. Looking through a guide aimlessly when you're a newbie is pointless without some kind of tip.

 

Been looking through that manual for a while now and it's nothing pertaining to me.

 

What I need is a way of executing that flash player script within the the echo thing.

 

This sounds doable.  Do you have a Database that has all the info of the video?  If so, you can load them in and build the page based on that information.

 

No, I don't have a database. Would you mind explaining how I can get that database built? I'd much rather code it myself (meaning all I need is an editor) because I'm not up for purchasing services atm.

 

I'd really just like a way of pulling this off:

 

if videos = Playlist1 and episode = 1 then final output that the user would see is the video "Playlist1Episode1"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.