Jump to content

okay for some reason this has stopped working...?


dbradbury

Recommended Posts

i had a php script that loads an image from an attachment from a post in my phpBB forum.

 

all of a sudden it has stopped..

 

my code:

 

loadimage.php

<?php
$image = $_GET['image'];
header('Content-Type: image/jpeg');
readfile('forum/files/'.$image);
?>

 

meettheplayers.php

-The displaying the image part....

<?php
if(isset($_GET['p']))
{
	$p = mysql_query("SELECT * FROM phpbb_posts WHERE post_id='$id'");
	$pi = mysql_fetch_assoc($p);
	$pid = $p['forum_id'];
	$idpic = mysql_query("SELECT * FROM phpbb_attachments WHERE post_msg_id='$pid'");
	$countid = mysql_num_rows($idpic);
	if($countid=0)
	{
		$row = mysql_fetch_assoc($idpic);
		if ($row['thumbnail'] =0)
			{
				print '<img src=loadimage.php?image='.$row['physical_filename'].'>';
			}
			else
			{
				print '<img src=loadimage.php?image=thumb_'.$row['physical_filename'].'>';
			}
	}
	else
	{
	//	print '<img src=../pictures/nopic.png width="225px" height"300px">';
	}
}		
?>

 

i now that there is a part near the end blanked out (//). i did that as that pic shows for them all..

so ive changed the count rule to =0 and !=0 but they both just blank the middle part of the code..

 

anyone got any idea?

 

if you need anymore info just tell me :) ill be happy to oblige

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.