Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GD library and things

Status
Not open for further replies.

boyfromoz

Technical User
Feb 1, 2001
469
AU
I'm fairly new to php and am experimenting with the gd library. Its causing me some concerns. The photos that are uploaded seem to change colour, and increase in size 5 fold. Has anyone else experienced this?

Checkitout here
Also, this page, Site ahs an admin area where admin can uplaod word docs and a link is added to this page. When I view the page on my computer I see the right data, which is April Newsletter and a link. When I go and visit the website owner and try it there... does not work? Both on pc xp ie6 same security settings, everything.

Code is

<?php
$qry=&quot;select distinct(year) from cms_newsletter order by year desc&quot;;
$res=mysql_query($qry);

echo mysql_error();

while($data=mysql_fetch_object($res))
{

?>
<table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;3&quot; class=formtable>
<tr>
<td>&nbsp;<B><?php echo $data->year; ?> Newsletters</B></td>
</tr>
<tr>
<td>
<table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;3&quot; class=&quot;formtable&quot;>
<?php
$detqry=&quot;select * from cms_newsletter where year='$data->year' order by id&quot;;
$detres=mysql_query($detqry);

echo mysql_error();

$month_arr=array();
$file_arr=array();

while($detdata=mysql_fetch_object($detres))
{
$month_arr[]=$detdata->month;
$file_arr[]=$detdata->filename;
}


// echo $data->year.&quot;-&quot;.count($file_arr);


for($i=0;$i<count($file_arr);$i++)
{
if($i%4==0)
{
?>
<tr>
<td width=&quot;25%&quot;>&nbsp;
<A href=&quot;upload/newsletter/<?php echo $file_arr[$i]; ?>&quot;><?php echo $month_arr[$i]; ?></a>
</td>
<td width=&quot;25%&quot;>&nbsp; <A href=&quot;upload/newsletter/<?php echo $file_arr[$i+1]; ?>&quot;><?php echo $month_arr[$i+1]; ?></a></td>
<td width=&quot;25%&quot;>&nbsp; <A href=&quot;upload/newsletter/<?php echo $file_arr[$i+2]; ?>&quot;><?php echo $month_arr[$i+2]; ?></a></td>
<td width=&quot;25%&quot;>&nbsp; <A href=&quot;upload/newsletter/<?php echo $file_arr[$i+3]; ?>&quot;><?php echo $month_arr[$i+3]; ?></a></td>
</tr>
<?php
}//end if
}//end for
?>
</table>
</td>
</tr>
</table>
<?php
}//end while
?>


Can anyone spot a problem?

Much gracious.

Help on either/both problems welcomed
 
I'm not sure why you would be using the GD library to upload files -- it's not necessary for the upload. What are you doing with the files using GD after they are uploaded?


The document upload section -- what does &quot;does not work&quot; mean? When I click on the link, my system attempts to download a file named 15042003134129aprilnews.doc. Is this incorrect behavior? I did not complete the download or open the file -- it's my standard policy with .doc files from unknown sites.

Want the best answers? Ask the best questions: TANSTAAFL!
 
gd library is used to build a galler, create a thumbnail and main image of fixed size.

The newsltter facility works perfectly as you describe, just not working on my clients computer.

 
how can I debug something I vcan't get to fail?
 
OK, this is the scoop.

ON my computer. It does not fail.

At my local internet cafe. it does not fail

At 3 other places. NO fail.

At clients office who has almost identical setup to me. Fail
 
The code runs. It's just that for some reason it does not return any data from the database. I recommend that you start there.

For example, if you perform a query that runs correctly, but returns no records, there is no MySQL error. But a while loop that is fetching on that query (while($data=mysql_fetch_object($res)))will never run.

What parts of the code are running and not running?

Want the best answers? Ask the best questions: TANSTAAFL!
 
Um OK.

Firstly, I was simply trying to clarify &quot;By your own account, it fails every time you use it.&quot; as this is not true.

Apologies if I offended, I did not intend or even have an inkling that my email would do so. I am used to ahving to make something over clear. most of my team ahve English as a 2nd language.

As it is, thankyou, you have solved my problem.

I placed text &quot;test1&quot; &quot;test2&quot; etc throughout the page and got my client to check where it failed... only to learn it fails BEFORE my php appears, so the problem is the weird caching of their ISP, nothing to do with my code.

So in any case, thank you.

You fixed my problem.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top