Video Codes?

SpaceshipSpaceship
Watch

Ericsson

VIP Member
Impact
8
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
well for one thing, thats all in php; the video, the link, everything. what it does is that the link has an ID number in the link (the ?song=1278 part). now depending on that number, im assuming the script accesses a database which tells the corresponding filename is.

grr this will take too long to explain in words, so ill just make a simply diagram.

1. Hyperlink on Page with ID number (www.abc.com/play.php?song=1234)
2. the link is clicked and play.php is loaded & parsed with $song as a variable (so in this case, $song = 1234)
3. in the page, it has the embed html code with php code in the part of where to get the video from. this code looks something like <? echo('/songs/' . $song . '.wmv'); ?>.
4. the video plays, and under the video is the sample code of the same thing above except it has all the other code that is needed for them to be able to put the song in their website.

simple as that.

hope it helped, if u have any questions, feel free to ask.

now about those NP$... hehe
 
0
•••
Have you got the code for that? lol
 
0
•••
lol its really easy to make, do you know any html/php?
 
0
•••
No thats why im asking. :)
 
0
•••
ok then lets see...

for index.html (or wherever u have all the links), put this:

HTML:
<a href="play.php?song=happybirthday">Click Here to Listen to Happy Birthday</a>

in the place where u wanna put the links. Change the part of "happybirthday" in the link to whatever the filename of the file is.

EXAMPLE: If the file you want to play is londonbridge.wmv, the link in the href tags would be "play.php?song=londonbridge" notice that the name of the file is the same as song=*FILENAME*

make a page called "play.php" and add all the html you want in it (like the layout, any links, etc).

In the part of the page where you want the video to play, put this code:


PHP:
<embed src="<?php echo($song); ?>.wmv" quality=high width="500" height="500">
  </embed>

if its in a subfolder (the song) just add the necessary stuff around it:
PHP:
<embed src="songs/<?php echo($song); ?>.wmv" quality=high width="500" height="500">
  </embed>

Then, underneath this code you can put something like this:
PHP:
<p>Add this movie to your site! Copy and paste the code below:</p>
<textarea cols="20" rows="5">
<embed src="http://www.yourdomain.com/songs/<?php echo($song); ?>.wmv" quality=high width="500" height="500">
<br>
<font size="1"><i>Brought to you by <a href="www.yourdomain.com">YourDomain.com</a></i></font>
</textarea>
<p>Please do not remove the credit line.</p>


And that's all there is to it! Remember, the file that plays the music needs to be play.php, not play.html.

I hope you can use this; I just put it together so if there are bugs, please tell me.

How about some NP$ for my efforts? :hehe:
 
0
•••
i used this method and when i tested it i looked at my page source & it only said it had .wmv & i did call it properly ?song=song.wmv but it said in the source code it was only .wmv and it never shown any kind of effort of it finding the file in the thread.
 
0
•••
ohh yeah i messed up that part of the script, i had just done it on the fly. sorry bout that.

simple fix:

anywhere you see $song in the php code, change it to $_GET['song'] and it shud work.

or, you can simply define that $song = $_GET['song'] somewhere in the php page.
 
0
•••
0
•••
great, glad i could help.

nice site you got there!
 
0
•••
Thanks nasaboy :)
 
0
•••
Appraise.net

We're social

Spaceship
Domain Recover
CatchDoms
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back