What's wrong with this? (new to PHP)

Automatic

User is banned.
Reputation
0
Code:
<?php
	switch(rand(0, 5)) {
		case 1:
		document.write("<img>http://static.php.net/www.php.net/images/php.gif</img>");
			break;
		case 2:
		document.write("<img>http://www.rsbuddy.com/forum/images/misc/logo-white.png</img>");
			break;
		case 3:
		document.write("<img>http://rsbuddy.com/campaign/images/UsfineRS728x90-1.gif</img>");
			break;
		case 4:
		document.write("<img>http://runegear.net/images/Banner.png</img>");
			break;
		case 5:
		document.write("<img>http://runegear.net/uploads/ficons/rs3.gif</img>");
			break;
	}
?>

Output:

http://automaticcoding.site90.net/ImageTest.php
 
Multiple things, actually.
1. document.write is a Javascript function, not a PHP function. You'd be better off using echo. (example: echo '<img src="sourcehere" />';)
2. In HTML, images aren't done like they are in BBCode. (example: <img src="sourcehere" />)
I see you're banned though, so there's no real point in me posting this :|
 
Back
Top