Jump to content

Image Upload and Rename


anthonydamasco

Recommended Posts

I have a search scripted,

www2.rubberduck4x4.com/OEM/

its a simple search, and it has a simple database,

partid
partnumber
description
price
catagory

I want to apply images to the search, so my plan is to match the "partnumber" with the image name

example Part# 1101 would be translated to 1101.jpg so all i would have to do is $partnumber.jpg

So I'm looking for a script that can upload and rename the file to match the part number, The partnumber will be entered on the same form that the image is uploaded, so it seems easy. I just dont know php enough to really understand the scripts that I've read

any assistance would be great
Link to comment
https://forums.phpfreaks.com/topic/34635-image-upload-and-rename/
Share on other sites

this code relates only to uploading the file
[code]

<form action="" method="post" enctype="multipart/form-data">
<table align=center>
<tr><td>File to upload:</td><td><input type="file" name="partpicture" /></td></tr>
<tr><td></td><td><input type="submit" value="upload and process" /></td></tr>
</table>

<?php

if($_FILES) {

$partpicture = $_FILES['partpicture']['tmp_name'];
$partpicture = $partnumber.'.jpg';
}[/code]

Archived

This topic is now archived and is closed to further replies.

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