Sarah
|
| Posted: 06/30/2002, 7:40 PM |
|
I am trying to get a record form to work with an upload. The Problem is when I use the upload it goes to an upload processing page and then redirects back to the original record, but when it goes back to the original record, it loses all of the original info and just shows the link to the image. I've tried adding input parameters and clicking transfer, but it doesn't seem to work. I'm stump. Anyone know how to fix it?
TIA
|
|
|
 |
Chris K.
|
| Posted: 06/30/2002, 11:59 PM |
|
Do you get your input parameter on redirected page, or no parameter is passed to redirect URL? Do you use PHP or some ASP upload component?
|
|
|
 |
Sarah
|
| Posted: 07/01/2002, 10:54 AM |
|
I am using php with templates. I guess I just don't understand where to pass the parameters. I have a page with a grid and record and the upload form on the footer of record> <FORM ENCTYPE="multipart/form-data" ACTION="UploadResultS.php?picture={value}" METHOD=POST><FONT Face=Arial>Attach Document</font>
<INPUT TYPE="hidden" NAME="id" VALUE="<?echo get_param("id");?>
<input type=file name=img1 size30><input type="submit" name="submit" value="Upload">
</form>. The upload form goes to a page called upload result that has this code in the page open event>
//user defined variables
$abpath = "/home/german/public_html/php/pictures"; //Absolute path to where images are uploaded. No trailing slash
$sizelim = "no"; //Do you want size limit, yes or no
$size = "2500000"; //What do you want size limited to be if there is one
//all image types to upload
$cert1 = "image/pjpeg"; //Jpeg type 1
$cert2 = "image/jpeg"; //Jpeg type 2
$cert3 = "image/gif"; //Gif type
$cert4 = "image/ief"; //Ief type
$cert5 = "image/png"; //Png type
$cert6 = "image/tiff"; //Tiff type
$cert7 = "image/bmp"; //Bmp Type
$cert8 = "image/vnd.wap.wbmp"; //Wbmp type
$cert9 = "image/x-cmu-raster"; //Ras type
$cert10 = "image/x-x-portable-anymap"; //Pnm type
$cert11 = "image/x-portable-bitmap"; //Pbm type
$cert12 = "image/x-portable-graymap"; //Pgm type
$cert13 = "image/x-portable-pixmap"; //Ppm type
$cert14 = "image/x-rgb"; //Rgb type
$cert15 = "image/x-xbitmap"; //Xbm type
$cert16 = "image/x-xpixmap"; //Xpm type
$cert17 = "image/x-xwindowdump"; //Xwd type
$log = "";
//begin upload 1
//checks if file exists
if ($img1_name == "") {
$log .= "No file selected for upload 1<br>";
}
if ($img1_name != "") {
//checks if file exists
if (file_exists("$abpath/$img1_name")) {
$log .= "File 1 already existed<br>";
} else {
//checks if files to big
if ($sizelim == "yes") {
if ($img1_size > $size) {
$log .= "File 1 was too big<br>";
}
}
//Checks if file is an image
if (($img1_type == $cert1) or ($img1_type == $cert2) or ($img1_type == $cert3) or ($img1_type == $cert4) or ($img1_type == $cert5) or ($img1_type == $cert6) or ($img1_type == $cert7) or ($img1_type == $cert8) or ($img1_type == $cert9) or ($img1_type == $cert10) or ($img1_type == $cert11) or ($img1_type == $cert12) or ($img1_type == $cert13) or ($img1_type == $cert14) or ($img1_type == $cert15) or ($img1_type == $cert16) or ($img1_type == $cert17)) {
@copy($img1, "$abpath/$img1_name") or $log .= "Couldn't copy image 1 to server<br>";
if (file_exists("$abpath/$img1_name")) {
$log .= "File 1 was uploaded<br>";
}
} else {
$log .= "File 1 is not an image<br>";
}
}
}
$picture ="pictures/$img1_name";
// Redirect the user to the AdminStudsRecord.php page
header("Location: AdminStudsRecord.php?picture=$picture");
Which forms do I use the input tabs to pass along data with the uploaded image Right now, if I upload a new picture to an existing record, when I get back to the record form I only have a link to the image, none of the original info is still filled in. You can probably tell I am new to programming:)
|
|
|
 |
|