Ok, I got some of it. I still think I'm confused about it (by the way, thanks for the help!). Here's what I've done but it still doesn't work:
this is viewclient.php
<?
session_start();
require_once("db.inc.php");
?>
<?
if ($id) {
$getClientData = mysql_query("SELECT * FROM clients WHERE id = '$id'") or die(mysql_error());
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Agent Filer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php if (session_is_registered('verified')) { ?>
<?php
$clientData = mysql_fetch_array($getClientData);
?>
<div align="center">
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?php include("header.inc.php"); ?></td>
</tr>
<tr>
<td><div class="viewClientTop">
<b><?=$clientData[lastName]?>,
<?=$clientData[firstName]?></b>
-
<?=$clientData[underwriter]?>
- POLICY EFFECTIVE
<?php echo(date("M d Y", $clientData[startdate])); ?>
to
<?php echo(date("M d Y", $clientData[expiredate])); ?>
</div>
</td>
</tr>
<tr>
<td valign="top" class="login"><p><a href="<?=$PHP_SELF?>?id=<?=$id?>&go=app" class="viewClientLinks">APPLICATIONS</a> <a href="<?=$PHP_SELF?>?id=<?=$id?>&go=dec" class="viewClientLinks">DECLARATIONS</a> <a href="<?=$PHP_SELF?>?id=<?=$id?>&go=notes" class="viewClientLinks">CLIENT NOTES</a></p>
<?php if ($go == "app") { ?>
<img src="resizeimage.php">
<p> </p>
<?php } ?>
<?php if ($go == "dec") { ?>
<p> </p>
<?php } ?>
<?php if ($go == "notes") { ?>
<p> </p>
<?php } ?>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</div>
<?
} else {
echo "<META HTTP-EQUIV='Refresh' CONTENT='0;URL=index.php'>";
}
?>
</body>
</html>
this is resizeimage.php
<?
if (!$_GET['dataid']) {
$getApps = mysql_query("SELECT id, location FROM data WHERE type = 'Application' AND clients_id = '$_GET[id]' ORDER BY uploadDate DESC LIMIT 1") or die(mysql_error());
} else {
$getApps = mysql_query("SELECT id, location FROM data WHERE type = 'Application' AND clients_id = '$id' AND id < $dataid ORDER BY uploadDate DESC LIMIT 1") or die(mysql_error());
}
//echo mysql_num_rows($getApps);
$getAppsArray = mysql_fetch_array($getApps);
//echo($getAppsArray[location]);
// The file
$filename = $getAppsArray[location];
$filetype = substr(basename($getAppsArray[location]), -3);
// Set a maximum height and width
$width = 400;
$height = 600;
// Content type
//header('Content-type: image/jpeg');
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}
//FILE TYPE JPG
if ($filetype == "jpg" || $filetype == "JPG") {
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// Output
imagejpeg($image_p, null, 100);
}
//FILE TYPE GIF
if ($filetype == "gif" || $filetype == "GIF") {
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromgif($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// Output
imagegif($image_p, $uploadfile);
}
//FILE TYPE PNG
if ($filetype == "png" || $filetype == "PNG") {
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefrompng($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// Output
imagepng($image_p, $uploadfile);
}
?>