Is this possible? If one file assigned to an ID...


Posted on 16th Feb 2014 07:03 pm by admin

I have a page that lists property listings assigned to a specific user (a manage page), with brief text details and a picture.

Each of these listings has several images with it, that aren't seen unless they click on the listing itself to edit/view it.

I'd like to put a warning next to the listing on this manage page if one or more of the images assigned to that listing id are over a certain size. I'm not quite sure how to do this. When I put in the code, I get an error at the top giving an filesize stat warning, listing all of the files run together:

Code: Warning: filesize() [function.filesize]: stat failed for re_images/1263001649_offer_christmasstory.jpg|1263001038_offer_TEST.jpg in
Here is the code I've got that has the problem:

Code: if($rows > '0')
{
$ListingTable .= "<table align=center width=510 border=1 bordercolor=black frame=hsides rules=rows cellspacing=0>n";

while($a1 = mysql_fetch_array($r1))
{
$size = filesize('re_images/'.$a1[image]);
if( $size > 153600 )
{
echo '<p align=center><img src="images/warning.gif" border="0"></p>';
$warning="<font color=#FF0000 size=5>!!</font></b>";
}

$ListingTable .= "<tr onMouseOver="this.style.background='#E2E2E2'; this.style.cursor='hand'" onMouseOut="this.style.background='white'" onClick="window.open('info.php?id=$a1[ListingID]', '_top')">nt";

if($a1[PriorityLevel] > '1')
{
//get the priority level name
$qp = "select PriorityName from re2_priority where PriorityLevel = '$a1[PriorityLevel]' ";
$rp = mysql_query($qp) or die(mysql_error());
$ap = mysql_fetch_array($rp);

$sub = "<span class=RedLink><sup>$ap[0]</sup></span>";
}
else
{
$sub = "";
}

$ListingTable .= "nt<td width=15>";

if(!empty($a1[image]))
{
$ListingTable .= "<img src="myimages/camera.jpg" width=15 height=15>$warning";
}

$ListingTable .= "</td>nt";
$ListingTable .= "<td width=305>$a1[city], $a1[state], $a1[address] $sub</td>nt";
$ListingTable .= "<td width=80>$a1[rooms] br, $a1[bathrooms] ba";
$MyPrice = number_format($a1[Price], 2, ".", ",");
$ListingTable .= "</td>nt<td align=center width=100><b>$$MyPrice</td>n";
$ListingTable .= "</tr>n";

}

$ListingTable .= "</table>";
}
I've coded this on the next page that shows all of the image, and it worked good. This one, I just couldn't figure out how to tell the server to look in the folder to see if any of the image associated with an id are a certain size

No comments posted yet

Your Answer:

Login to answer
337 Like 8 Dislike
Previous forums Next forums
Other forums

Need help to modify php ELSE code
I'm trying to find a way to have the php code display a message if there is no inventory listed in t

How to have a log of all the status a VIM document had been ?
Hi guys,

I’m using SAP Invoice Management plugin and the /OPT/VIM_ANALYTICS transa

Product categories for registration
Dear all,

We are going live with the Supplier registered next week. At standard, the 'sel

PHP Search Issue
Hi, I am using the following code to search and return flights from a database. The user searches by

php email checker
I am having alot of trouble finding info on how to do these email things. I need to do the following

Code Review - SQL and Insertion Attacks (Warning: Not for Newbs)
Hey guys,

Its been a while, I know. Use to love coming here to answer peoples questions, but

IMAGE - SERVER SIDE scripting help...
How to receive pixel data of an image and buid a bitmap file on the server using the HTTP POST metho

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

how to transport the Query and insfoset
Hi

I have created the query using SQ01........
How to created T-code for query..

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash