FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Can l make it so that an operatin will no longer take effect





KHO
alright, l have a php script that will play music on my site, each page plays different music at random based on this script (theoretical), but basically l am linking to the php script to play the sound, l can do this alternatively if it isn't possible with php, but l need a button that would disable music on all the pages, l was thinking maybe setting a cookie, and having an if function that would look for that cookie and if it is there then die the php script, l have everything down except the part where it does the die, how can l tell it to kill the script playing the music (named musicrt.php)? Do l have to add it to the script to play the music, then make the if look for a cookie, if it is there then die the script, else play the script. l guess l am really just asking if this would work, l am still very new to php, but have been looking at alot of scripts Neutral.
mathiaus
you can use exit; but anything below will not be used at all. I'd personally just wouldnt add the code if the cookie was set
Code:
if ($_COOKIE['nomusic'] != 1) {
include('music.php');
}

that way if the cookie isnt what its set at the music will play otherwise the code wont be included.
KHO
alright, sounds good, l was thinking there would be an easier way than what l had Neutral
Related topics
US health care changes take effect today. SUPER
How real id will effect you
Another Government Fail
What happens when Obama raises taxes?
What if I ran for office?
why I cannot use kf97.uni.cc domain admin help me!!
Can someone help me ? Com domain setup?
Pls help me someone.
DJ turntable out of an old mouse
New Drug Blocks HIV From Entering Cells
Windows Tips&tricks!
Trippling Your Download Speeds
Tips for Tweaking Xp
China Against the Internet
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.