Jump to content

Recommended Posts

Here's what i want to do, let me know if it's duable and then i can start figuring out how with some help :).

 

I make a variable

$idphoto = $firstname . " " . $lastname . ".jpg";

 

I have images on the server (images/ID) that are generic ID photos

male1.jpg female1.jpg.

 

Since upon data insertion through SQL the $idphoto image file is not yet available since the picture ID had most likely not been taken i want to find male1.jpg/female1.jpg and make a copy of that image and rename it into $idphoto.

 

The progress would run something like this :

 

Submit form with info

get info

check if img file exists with $idphoto name

if it does not - make copy of generic image and rename to $idphoto

if exists just insert that img name into the database

then rest is downhill.

 

Thanks 2 all :)

Link to comment
https://forums.phpfreaks.com/topic/155241-solved-duplicate-and-rename-image-files/
Share on other sites

If you're just using it as a default image if someone does not upload or choose one, whay make copies of it at all? They can all just point to the same image.

 

Then all you need to do is check for the image, if there isn't one put the path to your default.

 

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.