I have a problem and it is I have a table of songs without any link I have to link that song with a php name a prime example is http://apniisp.com/songs.php?id=656 like this can someone help me that how to do it?
I have a problem and it is I have a table of songs without any link I have to link that song with a php name a prime example is http://apniisp.com/songs.php?id=656 like this can someone help me that how to do it?
You can use MySQL to store the location of the file, and give it an ID.
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
to get the number that is set in that link
to find the songCode:$number = $_GET['id'];
and finally to play the songCode:$song = mysql_fetch_array(mysql_query("select * from songs where ID = $number"));
this is assuming you have a table called songs with 2 different rows called ID and linkCode:<EMBED SRC=<?php echo "$song['link']" ?> HEIGHT=0 WIDTH=0>
Last edited by Demonicman; 10-20-2007 at 03:56 PM.
should bePHP Code:$number = $_GET('id');
'cause you're not calling the $_GET() function. You are getting a value of the $_GET array.PHP Code:$number = $_GET['id'];
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
i knew that :P thanks though
I dont want people to embed the song I want them to download it with a php id, aren't it possible with a simple php code? I have to make tables in mysql?
Anything from the internet can be stolen.
Anyway, you can create a table, then retrieve it usingSELECTwith MySQL.
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
No worries if the songs will going to be stolen I don't know using MYSQL, wouldn't it possible by any JAVASCRIPT OR PHP?
Well, you could manually add all the URLs of the video files into an array, then retrieve 'em with ?id=123
Example:
PHP Code:$myvideos = array('link1.avi','link2.avi');
$id = $_GET['id'];
echo '<embed src="'.$myvideos[$id].'"></embed>';
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
Bookmarks