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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.