Jump to content


Photo

help


  • Please log in to reply
7 replies to this topic

#1 blankextacy

blankextacy
  • Members
  • PipPipPip
  • Advanced Member
  • 35 posts

Posted 18 October 2006 - 12:27 AM

could some one tell me why this isnt working

<?php
if (!$view) {
	print "Fight movie selection<br><br>
	<table>
	<tr><td width=100><b><u>Name</td><td width=100><b><u>Picture</td><td 

width=50><b><u>Description</td><td><b><u>Submitted</td><td><b><u>Options</td></tr>";

	$videos = mysql_query("select * from videos where type='fight' order by id");
	while ($video = mysql_fetch_array($videos)) {
		print "<tr><td>$video[name]</td><td><p><img src=$video[pic]
width="62" height="62"</p></td><td>$video[desc]</td><td>$video[submitted]</td><td>- <A 

href=fights.php?view=$video[id]>Play</a></td></tr>";
	}
	print "</table>";
}

if ($view) {
	$video = mysql_fetch_array(mysql_query("select * from videos where id=$view"));
	if (empty ($video[id])) {
		print "No such video. Go back to the <a href=videos.php>videos</a>.";
		
		exit;
	}
	if ($video[type] != pranks || funny || stupid || animated) {
		print "That's not a fight video. Go back to the <a href=videos.php>videos</a>.";
		
		exit;
	}
	print "<embed src='$video[link]' type='application/x-mplayer2' width='300' height='300' ShowControls='1' 

ShowStatusBar='0' loop='true' EnableContextMenu='0' autostart='true' DisplaySize='0' 

pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'></embed></div>";
	mysql_query("update players set credits=credits-$arm[cost] where id=$stat[id]");
}
?>

im not sure but the image part isnt working
<td><p><img src=$video[pic]
width="62" height="62"</p></td>

and the view part isnt working

#2 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 18 October 2006 - 12:30 AM

try putting ' before and after [ and ] so you get ['pic']
If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still

#3 rab

rab
  • Members
  • PipPipPip
  • Advanced Member
  • 155 posts

Posted 18 October 2006 - 12:31 AM

print "<img src=\"{$video['name']}\" />";

#4 blankextacy

blankextacy
  • Members
  • PipPipPip
  • Advanced Member
  • 35 posts

Posted 18 October 2006 - 12:37 AM

where does the width and height go?

#5 blankextacy

blankextacy
  • Members
  • PipPipPip
  • Advanced Member
  • 35 posts

Posted 18 October 2006 - 12:38 AM

if ($view) {
	$video = mysql_fetch_array(mysql_query("select * from videos where id=$view"));
	if (empty ($video[id])) {
		print "No such video. Go back to the <a href=videos.php>videos</a>.";
		
		exit;
	}
	if ($video[type] != pranks || funny || stupid || animated) {
		print "That's not a fight video. Go back to the <a href=videos.php>videos</a>.";
		
		exit;
	}
	print "<embed src='$video[link]' type='application/x-mplayer2' width='300' height='300' ShowControls='1' 

ShowStatusBar='0' loop='true' EnableContextMenu='0' autostart='true' DisplaySize='0' 

pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'></embed></div>";
	mysql_query("update players set credits=credits-$arm[cost] where id=$stat[id]");
}
?>
that part also doesnt work the site is http://revo-online.n...vies/fights.php as u can see when u click play ?view=1 comes up blank

#6 rab

rab
  • Members
  • PipPipPip
  • Advanced Member
  • 155 posts

Posted 18 October 2006 - 12:50 AM

if ($view) {
	$video = mysql_fetch_array(mysql_query("select * from videos where id=$view"));
	if (empty ($video[id])) {
		print "No such video. Go back to the <a href=videos.php>videos</a>.";
		
		exit;
	}
	if ($video[type] != pranks || funny || stupid || animated) {
		print "That's not a fight video. Go back to the <a href=videos.php>videos</a>.";
		
		exit;
	}
	print "<embed src='$video[link]' type='application/x-mplayer2' width='300' height='300' ShowControls='1' 

ShowStatusBar='0' loop='true' EnableContextMenu='0' autostart='true' DisplaySize='0' 

pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'></embed></div>";
	mysql_query("update players set credits=credits-$arm[cost] where id=$stat[id]");
}
?>
that part also doesnt work the site is http://revo-online.n...vies/fights.php as u can see when u click play ?view=1 comes up blank


First off, your not supposed to run a function within another function example: mysql_fetch_array(mysql_query());. Your MySQL query is vulnerable to SQL injections, please secure your $_GET variables.  Also with your array it should be $array['item'] or $array[3] not $array[video], And your if() statement is wrong. 

That was just after a glance at your code.

#7 blankextacy

blankextacy
  • Members
  • PipPipPip
  • Advanced Member
  • 35 posts

Posted 18 October 2006 - 01:10 AM

theres something else wrong if u goto the site ull se that there no errors when u press play and goto ?view=1 its doest show any thing just stays at the same page

#8 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 18 October 2006 - 04:46 AM

Post your current code.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users