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
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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