Unstoppable Domains โ€” Expired Auctions

Noob php help

SpaceshipSpaceship
Watch
Impact
91
hi

i am a newbie to php..

what i want to do is the following:
i have a php code with if command.. what i want is that if=true then it should play a sound (a midi file)

the code that i have managed to create is this
Code:
else

		{

			echo '<div>' "abcdefg is great person!" '<embed src="infinity.mid" /></div>';			
			
		}

but the following does not play any sound.. please tell me where i am going wrong..

thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
If you want to play it if the if statement is true then why have you got it in the else statement.


PHP:
<?php
$var = true;
if ($var == true)
{
	echo '<div> "abcdefg is great person!" <embed src="infinity.mid" /></div>';
}
else 
{
	// Don't play the sound as the $var is false;
}
?>

Also you had a couple of syntax errors caused by unneeded ' the 1 after <div> and the 1 before <embed were not needed.

It is quite highly frowned upon nowadays to have music playing on web sites especially if there is no way for it to be turned off. Also if you did not create the midi yourself then you may have copyright issues (especially if it is a midi of a commercially available song).
 
1
•••
u can say it is only a newbies curiosity taking over him.. (learning php)

anyways i canot even dream of using a midi file as my background music for my site..

this was just a sample program that i was interested in creating.. u can say it was my first or may be second program..

added some reps..
thanks
 
0
•••
please tell me is there any th8ing wrong in this code
Code:
			echo '<BODY onLoad="javascript: popUp('www.google.com')">';

it is saying the following error
Code:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/XXXXX/public_html/popup/index.php
 
0
•••
echo '<BODY onLoad="javascript: popUp(\'www.google.com\')">';


You need to escape (put a \ before) quotes of the same type as the containing quotes.

If you can't understand that:
If you use echo ' '; you need to put a \ before any 's.
If you use echo " "; you need to put a \ before any "s.
 
1
•••
please tell me what is wrong in this code? this does not put a popup when i place this code in php.. but if the same code is in a html file then i can see the popup coming
Code:
<?php
echo '<SCRIPT LANGUAGE="JavaScript"><!-- Begin 
window.open ("http://google.com","mywindow") 
// End --></script>';
?>
 
0
•••
there is nothing wrong with it, it works 100% for me.
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back