Orionsbelter Posted October 10, 2008 Share Posted October 10, 2008 I need some php coding for playing click.wav with i click the sound.jpg images. can anyone show me how to do it? thanks Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/ Share on other sites More sharing options...
The Little Guy Posted October 10, 2008 Share Posted October 10, 2008 That would be JavaScript, or flash. Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662217 Share on other sites More sharing options...
Orionsbelter Posted October 10, 2008 Author Share Posted October 10, 2008 No it wouldn't i've seen it in php i used to have a code but lost the script Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662226 Share on other sites More sharing options...
KevinM1 Posted October 10, 2008 Share Posted October 10, 2008 No it wouldn't Uh, yeah, it would. PHP doesn't do client-side events. Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662229 Share on other sites More sharing options...
Orionsbelter Posted October 10, 2008 Author Share Posted October 10, 2008 <embed src='.wav' autostart='true' loop='false' width='2' height='0'> </embed> i found that ERMMMMM thats called PHP!!!! Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662240 Share on other sites More sharing options...
thebadbad Posted October 10, 2008 Share Posted October 10, 2008 Nope, got that wrong mate That's HTML. Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662241 Share on other sites More sharing options...
KevinM1 Posted October 10, 2008 Share Posted October 10, 2008 Nope, got that wrong mate That's HTML. Not only that, but that audio file will start automatically when the page is viewed, not when an image is clicked. Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662244 Share on other sites More sharing options...
discomatt Posted October 10, 2008 Share Posted October 10, 2008 <embed src='.wav' autostart='true' loop='false' width='2' height='0'> </embed> i found that ERMMMMM thats called PHP!!!! That is pretty damn awesome. Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662245 Share on other sites More sharing options...
KevinM1 Posted October 10, 2008 Share Posted October 10, 2008 <embed src='.wav' autostart='true' loop='false' width='2' height='0'> </embed> i found that ERMMMMM thats called PHP!!!! That is pretty damn awesome. *snicker* Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662246 Share on other sites More sharing options...
Maq Posted October 10, 2008 Share Posted October 10, 2008 width='2' height='0'> i found that ERMMMMM thats called PHP!!!! wtf, this kid needs more than just PHP help... Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662251 Share on other sites More sharing options...
dennismonsewicz Posted October 10, 2008 Share Posted October 10, 2008 little orphan annie called... the sun will not come out tomorrow! Any takers? Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662258 Share on other sites More sharing options...
KevinM1 Posted October 10, 2008 Share Posted October 10, 2008 In all seriousness, PHP allows one to switch between scripting and outputting HTML in the same file. Example: <?php $title = "testing"; ?> <html> <head> <title><?php echo $title; ?></title> </head> <body> Wow, look, I'm normal text in an HTML document! </body> </html> The colored bits are PHP. The rest is HTML. This file would be saved as something.php, but that doesn't change the fact that the black-and-white bits are HTML. Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662262 Share on other sites More sharing options...
taith Posted October 11, 2008 Share Posted October 11, 2008 comon kids... be nice... and yes it is javascript :-) <scr ipt> function playSound(id){ if(document.embeds) document.embeds["sound"+id].play(); } </scr ipt> <embed SRC="beep.wav" HIDDEN="TRUE" AUTOSTART="false" name="sound1" loop="false"></embed> <a onclick="javascript:playSound('1');">play</a> Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662424 Share on other sites More sharing options...
DarkWater Posted October 11, 2008 Share Posted October 11, 2008 <embed src='.wav' autostart='true' loop='false' width='2' height='0'> </embed> i found that ERMMMMM thats called PHP!!!! That is pretty damn awesome. That made my day. Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662495 Share on other sites More sharing options...
dropfaith Posted October 11, 2008 Share Posted October 11, 2008 it makes my day that the user isnt on their first post to which to me indicates they have done some degree of coding in the past Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662496 Share on other sites More sharing options...
Stooney Posted October 11, 2008 Share Posted October 11, 2008 Dibs on the signature. Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662547 Share on other sites More sharing options...
Lamez Posted October 11, 2008 Share Posted October 11, 2008 http://www.php.net Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662550 Share on other sites More sharing options...
Maq Posted October 11, 2008 Share Posted October 11, 2008 it makes my day that the user isnt on their first post to which to me indicates they have done some degree of coding in the past I know right, 150 posts and he doesn't know the difference between php and js... Dibs on the signature. That's just too funny, I'm glad I was involved in this thread. On a more serious note, blmg911, if you need help you have to start attempting these tasks on your own. Like the previous posts visit php.net, tizag.com, there are thousands that teach you what you need to know piece by piece and if you need help we'll still be here.... Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662707 Share on other sites More sharing options...
DarkWater Posted October 11, 2008 Share Posted October 11, 2008 Dibs on the signature. LOL Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662855 Share on other sites More sharing options...
waynew Posted October 11, 2008 Share Posted October 11, 2008 Immortal [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662860 Share on other sites More sharing options...
DarkWater Posted October 11, 2008 Share Posted October 11, 2008 *Saves* Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-662927 Share on other sites More sharing options...
BoltZ Posted November 1, 2008 Share Posted November 1, 2008 <embed src='.wav' autostart='true' loop='false' width='2' height='0'> </embed> Maybe the code he originally saw was this.... <?php echo "<embed src='.wav' autostart='true' loop='false' width='2' height='0'></embed>"; ?> Lmfao Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-679879 Share on other sites More sharing options...
adrianTNT Posted November 1, 2008 Share Posted November 1, 2008 <embed src='.wav' autostart='true' loop='false' width='2' height='0'> </embed> i found that ERMMMMM thats called PHP!!!! [blmg911 Member Posts: 150] Quick, let's find his other posts Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-679946 Share on other sites More sharing options...
shlumph Posted November 1, 2008 Share Posted November 1, 2008 I love when websites play sounds Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-679976 Share on other sites More sharing options...
adrianTNT Posted November 1, 2008 Share Posted November 1, 2008 When you are done with the sound there is another cool thing to do, you don't want people to steal your work, so ... If someone right-clicks the site to steal images, show that system error with loud "DING !" and says "Protected content". I was mean, I know. Quote Link to comment https://forums.phpfreaks.com/topic/127911-play-sound-when-clicking-an-image/#findComment-679980 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.